This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/49169] ARM: optimisations strip the Thumb/ARM mode bit off function pointers
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 26 May 2011 08:21:47 +0000
- Subject: [Bug rtl-optimization/49169] ARM: optimisations strip the Thumb/ARM mode bit off function pointers
- Auto-submitted: auto-generated
- References: <bug-49169-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49169
--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-05-26 08:20:22 UTC ---
There are several places in the compiler where we assume DECL_ALIGN
constraints the lower bits of the address of the DECL.
See several similar bugs in the past (PR47239 comes to my mind).
fold-const.c:get_pointer_modulus_and_residue looks suspicious to me here,
so you might want to try
Index: gcc/fold-const.c
===================================================================
--- gcc/fold-const.c (revision 174266)
+++ gcc/fold-const.c (working copy)
@@ -9219,7 +9219,8 @@ get_pointer_modulus_and_residue (tree ex
*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);