http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55882



--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-08 
15:47:10 UTC ---

Ok with respect to alignment the issue is that when we expand_assignment

for to == dmfe[i_1].use_alt_rd_dqs we fall into the old trap for

STRICT_ALIGNMENT targets to use the mode alignment.  That's because

we fall into



          misalignp = false;

          to_rtx = expand_expr (tem, NULL_RTX, VOIDmode, EXPAND_WRITE);



which creates



(mem/c:BLK (plus:SI (reg/f:SI 189 virtual-stack-vars)

        (const_int 4 [0x4])) [0 dmfe+0 S992 A32])



as dmfe is 4-byte aligned.  With offset = (sizetype) i_1 * 124 + 2

and bitregion_start = 0, bitregion_end = 63, bitpos = 48 and after

adjusting the offset we feed



(mem/c:BLK (plus:SI (reg/f:SI 206)

        (const_int 6 [0x6])) [0 dmfe A16])



into set_mem_attributes_minus_bitpos (with bitpos == 48) and

get_object_alignment returns 32.  But we fail to consider bitpos

when using that alignment.



So ... does the following patch fix it for you?



Index: gcc/emit-rtl.c

===================================================================

--- gcc/emit-rtl.c      (revision 195014)

+++ gcc/emit-rtl.c      (working copy)

@@ -1839,7 +1839,13 @@ set_mem_attributes_minus_bitpos (rtx ref



       if (!align_computed)

        {

-         unsigned int obj_align = get_object_alignment (t);

+         unsigned int obj_align;

+         unsigned HOST_WIDE_INT obj_bitpos;

+         get_object_alignment_1 (t, &obj_align, &obj_bitpos);

+         if (apply_bitpos)

+           obj_bitpos += apply_bitpos;

+         if (obj_bitpos != 0)

+           obj_align = (obj_bitpos & -obj_bitpos);

          attrs.align = MAX (attrs.align, obj_align);

        }

     }

Reply via email to