re PR tree-optimization/47239 ((int)&func & 3 is always optimized to 0 on some targets)
authorRichard Guenther <rguenther@suse.de>
Tue, 11 Jan 2011 14:23:20 +0000 (14:23 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 11 Jan 2011 14:23:20 +0000 (14:23 +0000)
2011-01-11  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/47239
* tree-ssa-ccp.c (get_value_from_alignment): Punt for FUNCTION_DECLs.

From-SVN: r168661

gcc/ChangeLog
gcc/tree-ssa-ccp.c

index b372b6c7e68197a4e3dbb9f5178251f211fb6022..1a910c47c43b8c48a5be472035f27549ec4ff1cd 100644 (file)
@@ -1,3 +1,8 @@
+2011-01-11  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/47239
+       * tree-ssa-ccp.c (get_value_from_alignment): Punt for FUNCTION_DECLs.
+
 2011-01-11  Jeff Law  <law@redhat.com>
 
        * PR tree-optimization/47086
index b2494d72476ddb7a90be0f472f3e61521b2e10b6..57fc56d8ba7515a898585f337374edfd4636dd31 100644 (file)
@@ -522,6 +522,10 @@ get_value_from_alignment (tree expr)
     val = bit_value_binop (PLUS_EXPR, TREE_TYPE (expr),
                           TREE_OPERAND (base, 0), TREE_OPERAND (base, 1));
   else if (base
+          /* ???  While function decls have DECL_ALIGN their addresses
+             may encode extra information in the lower bits on some
+             targets (PR47239).  Simply punt for function decls for now.  */
+          && TREE_CODE (base) != FUNCTION_DECL
           && ((align = get_object_alignment (base, BIGGEST_ALIGNMENT))
                > BITS_PER_UNIT))
     {