On Wed, May 7, 2014 at 10:15 AM, Joseph S. Myers
<jos...@codesourcery.com> wrote:
> On Mon, 5 May 2014, Marek Polacek wrote:
>
>> In this PR the issue is that we reject (valid) code such as
>> _Alignas (long long) long long foo;
>> with -m32, because we trip this condition:
>>
>>    alignas_align = 1U << declspecs->align_log;
>>    if (alignas_align < TYPE_ALIGN_UNIT (type))
>>      {
>>        if (name)
>>          error_at (loc, "%<_Alignas%> specifiers cannot reduce "
>>                    "alignment of %qE", name);
>>
>> and error later on, since alignas_align is 4 (correct, see PR52023 for
>> why), but TYPE_ALIGN_UNIT of long long is 8.  I think TYPE_ALIGN_UNIT
>> is wrong here as that won't give us minimal alignment required.
>> In c_sizeof_or_alignof_type we already have the code to compute such
>> minimal alignment so I just moved the code to a separate function
>> and used that instead of TYPE_ALIGN_UNIT.
>>
>> Note that the test is run only on i?86 and x86_64, because we can't (?)
>> easily determine which target requires what alignment.
>>
>> Regtested/bootstrapped on x86_64-unknown-linux-gnu and
>> powerpc64-unknown-linux-gnu, ok for trunk?
>
> OK, though I'm not sure if the "lp64" conditions are right in the testcase

It should be !ia32 instead of lp64.

> (i.e. if x32 has the same peculiarity as -m32 here, which is what's
> implied by the use of "lp64").
>

Alignments of long long and long double on x32 are the same as x86-64.

-- 
H.J.

Reply via email to