diff options
author | Richard Sandiford <rsandifo@gcc.gnu.org> | 2011-06-27 09:33:06 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2011-06-27 09:33:06 +0000 |
commit | afc3f22f90ca9b2e1028949e671acf78dcb2b4b3 (patch) | |
tree | 9a1ad68c73f727bde3503eefc6ef4d5afc51c17d | |
parent | d38e4e3fc3eca21e6f2fec0c4d96d57acd203155 (diff) | |
download | gcc-afc3f22f90ca9b2e1028949e671acf78dcb2b4b3.zip gcc-afc3f22f90ca9b2e1028949e671acf78dcb2b4b3.tar.gz gcc-afc3f22f90ca9b2e1028949e671acf78dcb2b4b3.tar.bz2 |
re PR rtl-optimization/49169 (ARM: optimisations strip the Thumb/ARM mode bit off function pointers)
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
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fold-const.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr49169.c | 13 |
4 files changed, 27 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 76025df..e9dae06 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/fold-const.c b/gcc/fold-const.c index e48aae9..9428c11 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8c8e1b3..c833b41 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..721b2ac --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr49169.c @@ -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" } } */ |