re PR rtl-optimization/49169 (ARM: optimisations strip the Thumb/ARM mode bit off...
authorRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 27 Jun 2011 09:33:06 +0000 (09:33 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 27 Jun 2011 09:33:06 +0000 (09:33 +0000)
gcc/
2011-07-24  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/49169
* fold-const.c (get_pointer_modulus_and_residue): Don't rely on
the alignment of function decls.

gcc/testsuite/
2011-07-24  Michael Hope  <michael.hope@linaro.org>
    Richard Sandiford  <richard.sandiford@linaro.org>

PR tree-optimization/49169
* gcc.dg/torture/pr49169.c: New test.

From-SVN: r175427

gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr49169.c [new file with mode: 0644]

index 76025dfeddce5d6a13bb293d45199919d9cf2865..e9dae06a29c0c2968068f20f2a6ed0fa3145c121 100644 (file)
@@ -1,3 +1,9 @@
+2011-06-27  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/49169
+       * fold-const.c (get_pointer_modulus_and_residue): Don't rely on
+       the alignment of function decls.
+
 2011-06-26  Iain Sandoe  <iains@gcc.gnu.org>
 
        PR target/47997
index e48aae9f4ce19a2ed7538194524b091603bff87e..9428c11e4ac4db637f4f175c489f8cff30727451 100644 (file)
@@ -9216,7 +9216,8 @@ get_pointer_modulus_and_residue (tree expr, unsigned HOST_WIDE_INT *residue,
   *residue = 0;
 
   code = TREE_CODE (expr);
-  if (code == ADDR_EXPR)
+  if (code == ADDR_EXPR
+      && TREE_CODE (TREE_OPERAND (expr, 0)) != FUNCTION_DECL)
     {
       unsigned int bitalign;
       bitalign = get_object_alignment_1 (TREE_OPERAND (expr, 0), residue);
index 8c8e1b3dc79f9f7e0743378afdf4ec2dc198a7bc..c833b41a6209ddebd66a3386608d3157a942ee89 100644 (file)
@@ -1,3 +1,9 @@
+2011-06-27  Michael Hope  <michael.hope@linaro.org>
+           Richard Sandiford  <richard.sandiford@linaro.org>
+
+       PR tree-optimization/49169
+       * gcc.dg/torture/pr49169.c: New test.
+
 2011-06-26  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        PR testsuite/49529
diff --git a/gcc/testsuite/gcc.dg/torture/pr49169.c b/gcc/testsuite/gcc.dg/torture/pr49169.c
new file mode 100644 (file)
index 0000000..721b2ac
--- /dev/null
@@ -0,0 +1,13 @@
+#include <stdlib.h>
+#include <stdint.h>
+
+int
+main (void)
+{
+  void *p = main;
+  if ((intptr_t) p & 1)
+    abort ();
+  return 0;
+}
+
+/* { dg-final { scan-assembler "abort" } } */