From patchwork Fri Feb 21 04:24:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 25095 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BAB5D201EE for ; Fri, 21 Feb 2014 04:24:50 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id vb8sf10208375obc.9 for ; Thu, 20 Feb 2014 20:24:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:message-id:date:from:user-agent:mime-version:to:cc :subject:x-original-sender:x-original-authentication-results :content-type; bh=fl1jLyKR+TrzHoTP77hYV1giZEeXs/rDBpzb5obr0Ws=; b=MFoBkYLYx/eT+EyVcQvPeHSmPJEBEZJkUSu7h46APoO/+8iryUo9RU1msRnApcGYyb OgY+9c/pSl6f18V2+a3f/kveqkuqGqz10I7QHS8Zagh1F0GhGcbPdJMQhEBPAwi3ngyg vofRNzhsj1hdJrjfjcmxbZul2rW5r9wAwLpcwLzAQ3g/MywYeUidFC0HTNr1ZnbZeA+u cbuZuUQsAVLIFWxizh6a5wfFpGkl45SofL7p6f1Yzc1gvb7tvCkXFHHEstNofrSXZGN8 zaWqAmp/bPl3HhMylgKc/txZsoaQeBYZzL04tsFXjTfr/0vm6G6ex750WODpMSj2X7MX ZsEQ== X-Gm-Message-State: ALoCoQmHl3SHXAXbuucw6H4XB/8jOohIuH6t40V9y/HlnqrSBwjIjqYkX6iCmIvoYckrsF7Q8sMg X-Received: by 10.50.222.103 with SMTP id ql7mr1302290igc.1.1392956689999; Thu, 20 Feb 2014 20:24:49 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.240 with SMTP id b103ls885350qge.57.gmail; Thu, 20 Feb 2014 20:24:49 -0800 (PST) X-Received: by 10.52.25.135 with SMTP id c7mr2859782vdg.62.1392956689821; Thu, 20 Feb 2014 20:24:49 -0800 (PST) Received: from mail-ve0-x22c.google.com (mail-ve0-x22c.google.com [2607:f8b0:400c:c01::22c]) by mx.google.com with ESMTPS id a15si2504881vew.83.2014.02.20.20.24.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 20:24:49 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22c is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22c; Received: by mail-ve0-f172.google.com with SMTP id jz11so935475veb.3 for ; Thu, 20 Feb 2014 20:24:49 -0800 (PST) X-Received: by 10.220.98.204 with SMTP id r12mr3477760vcn.48.1392956689672; Thu, 20 Feb 2014 20:24:49 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp3943vcz; Thu, 20 Feb 2014 20:24:48 -0800 (PST) X-Received: by 10.68.201.226 with SMTP id kd2mr6440861pbc.157.1392956688392; Thu, 20 Feb 2014 20:24:48 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id wh10si5810167pab.220.2014.02.20.20.24.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Feb 2014 20:24:48 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-362153-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 11933 invoked by alias); 21 Feb 2014 04:24:35 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 11920 invoked by uid 89); 21 Feb 2014 04:24:34 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pb0-f48.google.com Received: from mail-pb0-f48.google.com (HELO mail-pb0-f48.google.com) (209.85.160.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 21 Feb 2014 04:24:33 +0000 Received: by mail-pb0-f48.google.com with SMTP id rr13so2872130pbb.21 for ; Thu, 20 Feb 2014 20:24:31 -0800 (PST) X-Received: by 10.66.251.42 with SMTP id zh10mr6709681pac.84.1392956671402; Thu, 20 Feb 2014 20:24:31 -0800 (PST) Received: from [192.168.1.100] (pa49-187-68-83.pa.nsw.optusnet.com.au. [49.187.68.83]) by mx.google.com with ESMTPSA id y9sm39963395pas.10.2014.02.20.20.24.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 20:24:30 -0800 (PST) Message-ID: <5306D4F9.6040901@linaro.org> Date: Fri, 21 Feb 2014 15:24:25 +1100 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Marcus Shawcroft , Richard Earnshaw Subject: [PATCH][AARCH64]PR60034 X-IsSubscribed: yes X-Original-Sender: kugan.vivekanandarajah@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22c is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 Hi all, Compiling inline asm results in ICE (PR60034). Alignment calculation in aarch64_classify_address for (symbol_ref:DI ("*.LANCHOR4") [flags 0x182])) seems wrong here. Fixing this also caused a regression for pr38151.c, which is due to complex type being allocated with wrong alignment. Attached patch fixes these issues. Regression tested on qemu-aarch64 for aarch64-none-linux-gnu with no new regressions. Is this patch OK? Thanks, Kugan gcc/ +2014-02-21 Kugan Vivekanandarajah + + PR target/60034 + * aarch64/aarch64.c (aarch64_classify_address): Fix alignment for + SYMBOL_REF_FLAGS. + * aarch64/aarch64.h (DATA_ALIGNMENT): Fix alignment for COMPLEX_TYPE. + gcc/testsuite/ +2014-02-21 Kugan Vivekanandarajah + + PR target/60034 + * gcc.target/aarch64/pr60034.c: New file. + diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index ea90311..89187c0 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -3203,6 +3203,8 @@ aarch64_classify_address (struct aarch64_address_info *info, } else if (SYMBOL_REF_DECL (sym)) align = DECL_ALIGN (SYMBOL_REF_DECL (sym)); + else if (SYMBOL_REF_FLAGS (sym)) + align = GET_MODE_ALIGNMENT (GET_MODE (sym)); else align = BITS_PER_UNIT; diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index 13c424c..b93e9da 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -132,6 +132,7 @@ ((((ALIGN) < BITS_PER_WORD) \ && (TREE_CODE (EXP) == ARRAY_TYPE \ || TREE_CODE (EXP) == UNION_TYPE \ + || TREE_CODE (EXP) == COMPLEX_TYPE \ || TREE_CODE (EXP) == RECORD_TYPE)) \ ? BITS_PER_WORD : (ALIGN)) diff --git a/gcc/testsuite/gcc.target/aarch64/pr60034.c b/gcc/testsuite/gcc.target/aarch64/pr60034.c index e69de29..99c821d 100644 --- a/gcc/testsuite/gcc.target/aarch64/pr60034.c +++ b/gcc/testsuite/gcc.target/aarch64/pr60034.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99 -fgnu89-inline -O -Wall -Winline -Wwrite-strings -fmerge-all-constants -frounding-math -g -Wstrict-prototypes" } */ + +static unsigned long global_max_fast; + +int __libc_mallopt (int param_number, int value) +{ + __asm__ __volatile__ ("# %[_SDT_A21]" :: [_SDT_A21] "nr" ((global_max_fast))); + global_max_fast = 1; +}