On Thu, Apr 14, 2011 at 5:48 PM, H.J. Lu <hjl.to...@gmail.com> wrote:
> On Thu, Apr 14, 2011 at 8:26 AM, Michael Matz <m...@suse.de> wrote:
>> Hi,
>>
>> On Thu, 14 Apr 2011, Richard Guenther wrote:
>>
>>> > +  if (align > DECL_ALIGN (decl))
>>> > +    DECL_ALIGN (decl) = align;
>>>
>>> Shouldn't this unconditionally set DECL_ALIGN in case
>>> LOCAL_DECL_ALINGMENT returns something smaller?
>>
>> Decreasing alignment of DECLs points to a problem elsewhere, so perhaps an
>> assert that this doesn't happen is better.  Decreasing is a problem
>> because it's not conservative: there might have been code generated
>> already assuming the once larger alignment that then possibly breaks if it
>> turns out the alignment is actually smaller.
>
> ia32 may decrease local variable alignment:
>
>  /* Don't do dynamic stack realignment for long long objects with
>     -mpreferred-stack-boundary=2.  */
>  if (!TARGET_64BIT
>      && align == 64
>      && ix86_preferred_stack_boundary < 64
>      && (mode == DImode || (type && TYPE_MODE (type) == DImode))
>      && (!type || !TYPE_USER_ALIGN (type))
>      && (!decl || !DECL_USER_ALIGN (decl)))
>    align = 32;
>
> I am running bootstrap/test on Linux/x86-64 and Linux/ia32.

That's broken.  It may cause explicit alignment checks to be bogously
optimized away.

Richard.

> --
> H.J.
>

Reply via email to