From patchwork Mon Mar 3 21:56:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 25631 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CE419206F3 for ; Mon, 3 Mar 2014 21:56:54 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id bj1sf11924110pad.11 for ; Mon, 03 Mar 2014 13:56:54 -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:references:in-reply-to:x-original-sender :x-original-authentication-results:content-type; bh=cWUyU6kgXmjgCHHBaeu/dqYqn0+cUX09aaguwaWRxJ0=; b=V0Zobpg3DVBTcKuFGooxjwTOkCiTItpEkoSxzmkl12ciYwh/PbSgeB1xFsROSW0nsl Fsrsm5vmvgczP9r6p7niHGPk/68MauNf+luEWsumdtFtTQtaswQ0VP2OkSCfYWlrU//M uatcyiuCIarpnpbVfwEBRhjYc93SqmYe59Zm8cISf5GEZ1m58sFXPGUvwGmdgZdBTsuq Ckqr6oJBzSPjOuctSRQM0MsN09l7uF+/ieLiV1pUbWusgPkzIozohJ1kox6yZNK5d+QR dhvxOPMekEqPN1Vq7lViXxR+QUA8ed8kakgJ6L5YlaAfKkTQqqlGjanRLRJx/jwKaPkX AVcA== X-Gm-Message-State: ALoCoQmWqKR0cQuthHRdS7lo9zywXWKWMWI1o01bIMLNwcLiwE5kdRN64VjIXea8yNBwh1M4SZ5l X-Received: by 10.66.159.36 with SMTP id wz4mr920337pab.14.1393883814079; Mon, 03 Mar 2014 13:56:54 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.230 with SMTP id z93ls2420781qgz.93.gmail; Mon, 03 Mar 2014 13:56:53 -0800 (PST) X-Received: by 10.58.18.231 with SMTP id z7mr126184ved.40.1393883813871; Mon, 03 Mar 2014 13:56:53 -0800 (PST) Received: from mail-ve0-x22b.google.com (mail-ve0-x22b.google.com [2607:f8b0:400c:c01::22b]) by mx.google.com with ESMTPS id av10si3609881ved.150.2014.03.03.13.56.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Mar 2014 13:56:53 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22b 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::22b; Received: by mail-ve0-f171.google.com with SMTP id cz12so4304665veb.16 for ; Mon, 03 Mar 2014 13:56:53 -0800 (PST) X-Received: by 10.52.141.105 with SMTP id rn9mr102640vdb.44.1393883813723; Mon, 03 Mar 2014 13:56:53 -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.130.193 with SMTP id u1csp83144vcs; Mon, 3 Mar 2014 13:56:53 -0800 (PST) X-Received: by 10.68.249.34 with SMTP id yr2mr11760714pbc.11.1393883812041; Mon, 03 Mar 2014 13:56:52 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id yn4si11933683pab.255.2014.03.03.13.56.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Mar 2014 13:56:52 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-362682-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 30661 invoked by alias); 3 Mar 2014 21:56:39 -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 30652 invoked by uid 89); 3 Mar 2014 21:56:38 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=BAYES_00, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pd0-f170.google.com Received: from mail-pd0-f170.google.com (HELO mail-pd0-f170.google.com) (209.85.192.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 03 Mar 2014 21:56:37 +0000 Received: by mail-pd0-f170.google.com with SMTP id v10so2199114pde.1 for ; Mon, 03 Mar 2014 13:56:35 -0800 (PST) X-Received: by 10.66.9.41 with SMTP id w9mr1890550paa.39.1393883795417; Mon, 03 Mar 2014 13:56:35 -0800 (PST) Received: from [10.135.102.58] (n182z4l226.static.ctm.net. [182.93.4.226]) by mx.google.com with ESMTPSA id hb10sm40147805pbd.1.2014.03.03.13.56.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Mar 2014 13:56:34 -0800 (PST) Message-ID: <5314FA90.6010807@linaro.org> Date: Tue, 04 Mar 2014 08:56:32 +1100 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Marcus Shawcroft CC: "gcc-patches@gcc.gnu.org" , Richard Earnshaw Subject: Re: [PATCH][AARCH64]PR60034 References: <5306D4F9.6040901@linaro.org> In-Reply-To: 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::22b 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 On 27/02/14 22:32, Marcus Shawcroft wrote: > On 21 February 2014 04:24, Kugan wrote: > >> Compiling inline asm results in ICE (PR60034). Alignment calculation in >> aarch64_classify_address for (symbol_ref:DI ("*.LANCHOR4") [flags >> 0x182])) seems wrong here. > > Hi Kugan, > > + else if (SYMBOL_REF_FLAGS (sym)) > + align = GET_MODE_ALIGNMENT (GET_MODE (sym)); > > This is inserted into the LO_SUM handling in the function > aarch64_classify_address(), the code in question is checking the > alignment of the object to ensure that a scaled address instruction > would be valid. The proposed code is testing if any of a bunch of > unrelated predicate flags have been set on the symbol and using that > to gate whether GET_MODE_ALIGNMENT would give accurate alignment > information on the symbol. I'm not convinced that the presence of > SYMBOL_REF_FLAGS states anything definitive about the relevance of > GET_MODE_ALIGNMENT. The test looks like it fails because a section > anchor has been introduced and we fail to determine anything sensible > about the alignment of a section anchor. How about this instead? > > if (SYMBOL_REF_BLOCK (sym)) > align = SYMBOL_REF_BLOCK (sym)->alignment; > Thanks Marcus for the explanation. I have now changed it based on this and regression tested on qemu-aarch64 for aarch64-none-linux-gnu with no new regressions. Is this OK? >> >> 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. > > It ~might~ be beneficial to increase data_alignment here as suggest > for performance reasons, but the existing alignment should not cause > breakage... this issue suggest to me that the SYMBOL_REF_FLAGS > approach is at fault. > Removing this hunk. I will post it as a desperate patch after more analysis. Thanks, Kugan gcc/ 2014-03-03 Kugan Vivekanandarajah PR target/60034 * aarch64/aarch64.c (aarch64_classify_address): Fix alignment for section anchor. gcc/testsuite/ 2014-03-03 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 901ad3d..d2a9217 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -3199,6 +3199,10 @@ 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_HAS_BLOCK_INFO_P (sym) + && SYMBOL_REF_ANCHOR_P (sym) + && SYMBOL_REF_BLOCK (sym) != NULL) + align = SYMBOL_REF_BLOCK (sym)->alignment; else align = BITS_PER_UNIT; diff --git a/gcc/testsuite/gcc.target/aarch64/pr60034.c b/gcc/testsuite/gcc.target/aarch64/pr60034.c index e69de29..d126779 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; + +void __libc_mallopt (int param_number, int value) +{ + __asm__ __volatile__ ("# %[_SDT_A21]" :: [_SDT_A21] "nr" ((global_max_fast))); + global_max_fast = 1; +}