diff mbox

[C] Don't reject valid code with _Alignas (PR c/61053)

Message ID CAMe9rOqjbdkt4JjWOx8OXdkx6mrDnAgWWYoBsL7mo3QXS30nUw@mail.gmail.com
State New
Headers show

Commit Message

H.J. Lu Sept. 2, 2014, 10:29 p.m. UTC
On Thu, May 8, 2014 at 11:19 AM, Marek Polacek <polacek@redhat.com> wrote:
> On Wed, May 07, 2014 at 11:31:38AM -0700, H.J. Lu wrote:
>> > OK, though I'm not sure if the "lp64" conditions are right in the testcase
>>
>> It should be !ia32 instead of lp64.
>
> Ok, I changed lp64 to ! { ia32 } and committed the patch now.
>
>         Marek

The change is insufficient for x32, which has the same alignments
for floating point types and the integer types with the same size as
x86-64.  This patch is needed for x32.  OK for trunk and 4.8 branch?
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.dg/pr61053.c b/gcc/testsuite/gcc.dg/pr61053.c
index 4fd5319..5557784 100644
--- a/gcc/testsuite/gcc.dg/pr61053.c
+++ b/gcc/testsuite/gcc.dg/pr61053.c
@@ -31,17 +31,17 @@  _Alignas (long double) int ild;

 _Alignas (char) long int lic; /* { dg-error "cannot reduce alignment" } */
 _Alignas (short int) long int lis; /* { dg-error "cannot reduce alignment" } */
-_Alignas (int) long int lii; /* { dg-error "cannot reduce alignment"
"" { target { ! { ia32 } } } } */
+_Alignas (int) long int lii; /* { dg-error "cannot reduce alignment"
"" { target { ! { ia32 || x32 } } } } */
 _Alignas (long int) long int lil;
 _Alignas (long long int) long int lill;
-_Alignas (float) long int lif; /* { dg-error "cannot reduce
alignment" "" { target { ! { ia32 } } } } */
+_Alignas (float) long int lif; /* { dg-error "cannot reduce
alignment" "" { target { ! { ia32 || x32 } } } } */
 _Alignas (double) long int lid;
 _Alignas (long double) long int lild;

 _Alignas (char) long long int llic; /* { dg-error "cannot reduce
alignment" } */
 _Alignas (short int) long long int llis; /* { dg-error "cannot reduce