This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On Tue, Sep 2, 2014 at 3:29 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> 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?
>
>
> --
> H.J.
> ---
> 2014-09-02  H.J. Lu  <hongjiu.lu@intel.com>
>
> * gcc.dg/pr61053.c: Updated for x32.
>

Here is the patch as an attachment.


-- 
H.J.
2014-09-02  H.J. Lu  <hongjiu.lu@intel.com>

	* gcc.dg/pr61053.c: Updated for x32.

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 alignment" } */
 _Alignas (int) long long int llii; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */
-_Alignas (long int) long long int llil;
+_Alignas (long int) long long int llil; /* { dg-error "cannot reduce alignment" "" { target { x32 } } } */
 _Alignas (long long int) long long int llill;
 _Alignas (float) long long int llif; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */
 _Alignas (double) long long int llid;
@@ -59,7 +59,7 @@ _Alignas (long double) float fld;
 _Alignas (char) double dc; /* { dg-error "cannot reduce alignment" } */
 _Alignas (short int) double ds; /* { dg-error "cannot reduce alignment" } */
 _Alignas (int) double di; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */
-_Alignas (long int) double dl;
+_Alignas (long int) double dl; /* { dg-error "cannot reduce alignment" "" { target { x32 } } } */
 _Alignas (long long int) double dll;
 _Alignas (float) double df; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */
 _Alignas (double) double dd;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]