aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@gcc.gnu.org>2011-06-27 09:33:06 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2011-06-27 09:33:06 +0000
commitafc3f22f90ca9b2e1028949e671acf78dcb2b4b3 (patch)
tree9a1ad68c73f727bde3503eefc6ef4d5afc51c17d /gcc/fold-const.c
parentd38e4e3fc3eca21e6f2fec0c4d96d57acd203155 (diff)
downloadgcc-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
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c3
1 files changed, 2 insertions, 1 deletions
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);