From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108002 invoked by alias); 9 Jul 2015 06:02:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 107989 invoked by uid 89); 9 Jul 2015 06:02:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_40,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f53.google.com Received: from mail-oi0-f53.google.com (HELO mail-oi0-f53.google.com) (209.85.218.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 09 Jul 2015 06:02:50 +0000 Received: by oihr66 with SMTP id r66so126454331oih.2 for ; Wed, 08 Jul 2015 23:02:48 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.77.76 with SMTP id a73mr12463740oib.80.1436421768926; Wed, 08 Jul 2015 23:02:48 -0700 (PDT) Received: by 10.60.147.170 with HTTP; Wed, 8 Jul 2015 23:02:48 -0700 (PDT) In-Reply-To: <20150708225346.GA26795@intel.com> References: <20150708225346.GA26795@intel.com> Date: Thu, 09 Jul 2015 06:02:00 -0000 Message-ID: Subject: Re: [PATCH] PR target/66818: Define ATTRIBUTE_ALIGNED_VALUE to 32 for IA MCU From: Uros Bizjak To: "H.J. Lu" Cc: "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-07/txt/msg00676.txt.bz2 On Thu, Jul 9, 2015 at 12:53 AM, H.J. Lu wrote: > attribute ((aligned)) should align to the minimum of BIGGEST_ALIGNMENT, > which is 4 bytes for -miamcu. > > Tested on Linux/x86-64. OK for trunk? > > Thanks. > > H.J. > --- > gcc/ > > PR target/66818 > * config/i386/i386.h (ATTRIBUTE_ALIGNED_VALUE): Defined to 32 > for IA MCU. > > gcc/testsuite/ > > PR target/66818 > * gcc.target/i386/pr66818.c: New test. OK. Thanks, Uros. > --- > gcc/config/i386/i386.h | 2 +- > gcc/testsuite/gcc.target/i386/pr66818.c | 5 +++++ > 2 files changed, 6 insertions(+), 1 deletion(-) > create mode 100644 gcc/testsuite/gcc.target/i386/pr66818.c > > diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h > index f357e79..74334ff 100644 > --- a/gcc/config/i386/i386.h > +++ b/gcc/config/i386/i386.h > @@ -811,7 +811,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); > > /* Alignment value for attribute ((aligned)). It is a constant since > it is the part of the ABI. We shouldn't change it with -mavx. */ > -#define ATTRIBUTE_ALIGNED_VALUE 128 > +#define ATTRIBUTE_ALIGNED_VALUE (TARGET_IAMCU ? 32 : 128) > > /* Decide whether a variable of mode MODE should be 128 bit aligned. */ > #define ALIGN_MODE_128(MODE) \ > diff --git a/gcc/testsuite/gcc.target/i386/pr66818.c b/gcc/testsuite/gcc.target/i386/pr66818.c > new file mode 100644 > index 0000000..d90394c > --- /dev/null > +++ b/gcc/testsuite/gcc.target/i386/pr66818.c > @@ -0,0 +1,5 @@ > +/* { dg-do compile { target ia32 } } */ > +/* { dg-options "-O2 -mno-sse -mno-mmx -miamcu" } */ > + > +struct dummy { int x __attribute__((aligned)); }; > +int array[__alignof__(struct dummy) == 4 ? 1 : -1]; > -- > 2.4.3 >