From patchwork Tue Sep 2 22:29:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 385344 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41D8C140171 for ; Wed, 3 Sep 2014 08:29:45 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=O2RQtojuV2qkrhZ8Mm 36sPLLHqAv0t8GGUSVDttGQKm1ARZbSOWfjvwRJ1iwB/VNIn9YK/S2/nsktwIrmh w5NPslYe/M54eqldoWeUBEsNLx2ese66zp6YfsL3dAjzel1MjfMG+bR+f1YFC9/C hTRfYwF7/Mf9eqphF2ZTJGLUc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=ArOOUvblqoknt2mLFZLbOPaA C1o=; b=XHD84XtLywH1T0F9Iy3MaAkeD+egu576zO5P2k3N+6wWlOA2t39NnP6l gbyHKuXyOovmfVWVgA+3hJB0aU2FMH6yhuKPxDnqu6678ipypQOkRKfv211mOjWB d7kTnBEBzrBUYD7ryJYubdpQapVx/DVA8WFwdYGa51VZDplqs9U= Received: (qmail 21847 invoked by alias); 2 Sep 2014 22:29:39 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 21834 invoked by uid 89); 2 Sep 2014 22:29:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f173.google.com Received: from mail-ob0-f173.google.com (HELO mail-ob0-f173.google.com) (209.85.214.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 02 Sep 2014 22:29:27 +0000 Received: by mail-ob0-f173.google.com with SMTP id uy5so5449133obc.4 for ; Tue, 02 Sep 2014 15:29:25 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.220.226 with SMTP id pz2mr4663778obc.76.1409696965682; Tue, 02 Sep 2014 15:29:25 -0700 (PDT) Received: by 10.76.72.4 with HTTP; Tue, 2 Sep 2014 15:29:25 -0700 (PDT) In-Reply-To: <20140508181934.GD11802@redhat.com> References: <20140505202703.GR11802@redhat.com> <20140508181934.GD11802@redhat.com> Date: Tue, 2 Sep 2014 15:29:25 -0700 Message-ID: Subject: Re: [C PATCH] Don't reject valid code with _Alignas (PR c/61053) From: "H.J. Lu" To: Marek Polacek Cc: "Joseph S. Myers" , GCC Patches X-IsSubscribed: yes On Thu, May 8, 2014 at 11:19 AM, Marek Polacek 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 --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