From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119972 invoked by alias); 8 Jul 2015 22:53:49 -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 119962 invoked by uid 89); 8 Jul 2015 22:53:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,NO_DNS_FOR_FROM,RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mga09.intel.com Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Jul 2015 22:53:48 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 08 Jul 2015 15:53:46 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([172.25.70.52]) by fmsmga001.fm.intel.com with ESMTP; 08 Jul 2015 15:53:46 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 1000) id 776EEC41EC; Wed, 8 Jul 2015 15:53:46 -0700 (PDT) Date: Wed, 08 Jul 2015 22:53:00 -0000 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org, Uros Bizjak Subject: [PATCH] PR target/66818: Define ATTRIBUTE_ALIGNED_VALUE to 32 for IA MCU Message-ID: <20150708225346.GA26795@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-07/txt/msg00661.txt.bz2 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. --- 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