Comment 21 for bug 721531

Revision history for this message
In , Rguenth (rguenth) wrote :

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);