From patchwork Tue Mar 25 04:55:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 26966 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ADB9220062 for ; Tue, 25 Mar 2014 04:55:40 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id w5sf14468549qac.8 for ; Mon, 24 Mar 2014 21:55:40 -0700 (PDT) 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=WDaMSz14ONdFxM7BxMmsK644pMpGaT7cdDGtIFNLV5o=; b=CvZp0UteynT8AqBoYLoxUffaBfb66/TtcJo+WMOdHdZQmp60nY2oI+Raumr8QKPlLH AHia0NVWfE9IjRi72JS0VKBBIxLPixE3um+XMu54ORa/43zt7KE6z3bY9v1fpYDeuijk QPQ2NprsFthXD8grd2VEHeQlkEDVmiFIWnPBUPetfaiqxVa+KUaOxKIO1serSjVJkgn6 AhTLQ4oBjjG2Jn14kKeDBN38rQ0wDTA3lChEgGLV/X7RpGdB7hLZA15KeT16nesnuCPo rUa1VVG64kyvmmXfbYUqB6z0zumppW1O+DP2DPXwVckVpz2sbXeQsOzjl+H8OZmdt9qG m8tw== X-Gm-Message-State: ALoCoQmSLyQOHM/LLCwjc1PKLfd3ObBw+3vtzau0JPn5ObQODjoXQ/31OA9xBEsx5GXibgK2G1TJ X-Received: by 10.58.151.212 with SMTP id us20mr17106124veb.14.1395723340169; Mon, 24 Mar 2014 21:55:40 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.72 with SMTP id s66ls77380qgs.85.gmail; Mon, 24 Mar 2014 21:55:40 -0700 (PDT) X-Received: by 10.58.31.136 with SMTP id a8mr9192671vei.20.1395723340056; Mon, 24 Mar 2014 21:55:40 -0700 (PDT) Received: from mail-ve0-x22e.google.com (mail-ve0-x22e.google.com [2607:f8b0:400c:c01::22e]) by mx.google.com with ESMTPS id sj10si3465436vcb.15.2014.03.24.21.55.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Mar 2014 21:55:40 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22e 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::22e; Received: by mail-ve0-f174.google.com with SMTP id oz11so6807184veb.33 for ; Mon, 24 Mar 2014 21:55:40 -0700 (PDT) X-Received: by 10.58.185.145 with SMTP id fc17mr54917497vec.14.1395723339932; Mon, 24 Mar 2014 21:55:39 -0700 (PDT) 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.78.9 with SMTP id i9csp275215vck; Mon, 24 Mar 2014 21:55:39 -0700 (PDT) X-Received: by 10.68.227.4 with SMTP id rw4mr77635115pbc.3.1395723338515; Mon, 24 Mar 2014 21:55:38 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id tk5si10553500pbc.424.2014.03.24.21.55.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Mar 2014 21:55:38 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-363867-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 29946 invoked by alias); 25 Mar 2014 04:55:24 -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 29935 invoked by uid 89); 25 Mar 2014 04:55:23 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-yh0-f47.google.com Received: from mail-yh0-f47.google.com (HELO mail-yh0-f47.google.com) (209.85.213.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 25 Mar 2014 04:55:21 +0000 Received: by mail-yh0-f47.google.com with SMTP id 29so6254988yhl.34 for ; Mon, 24 Mar 2014 21:55:19 -0700 (PDT) X-Received: by 10.236.123.38 with SMTP id u26mr9358332yhh.93.1395723319197; Mon, 24 Mar 2014 21:55:19 -0700 (PDT) Received: from [10.1.1.8] (58-6-183-210.dyn.iinet.net.au. [58.6.183.210]) by mx.google.com with ESMTPSA id 48sm26900607yhq.11.2014.03.24.21.55.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Mar 2014 21:55:17 -0700 (PDT) Message-ID: <53310C2A.6030106@linaro.org> Date: Tue, 25 Mar 2014 15:55:06 +1100 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.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> <5314FA90.6010807@linaro.org> <532027DD.7020102@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::22e 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 >> If I understand gcc/rtl.h correctly, SYMBOL_REF_ANCHOR_P (sym) is >> required for anchor SYMBOL_REFS. SYMBOL_REF_BLOCK (sym) != NULL is >> probably redundant. This can probably become an gcc_assert >> (SYMBOL_REF_BLOCK (sym)) instead. > > I agree with your interpretation of the code and comments in rtl.h. I > also accept that SYMBOL_REF_ANCHOR_P() is sufficient to resolve the > test case. However I'm wondering why we need to constraint the test > down to SYMBOL_REF_ANCHOR_P(). At this point in the code we are > trying to find alignment of the object, if we have a SYMBOL_REF_BLOCK > then we can get the block alignment irrespective of > SYMBOL_REF_ANCHOR_P(). Thanks for the explanation. Is the attached patch looks OK ? Thanks, Kugan gcc/ 2014-03-25 Kugan Vivekanandarajah PR target/60034 * aarch64/aarch64.c (aarch64_classify_address): Fix alignment for section anchor. gcc/testsuite/ 2014-03-25 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 57b6645..7d2d10c 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -3193,6 +3193,9 @@ 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_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..ab7e7f4 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 -O" } */ + +static unsigned long global_max_fast; + +void __libc_mallopt (int param_number, int value) +{ + __asm__ __volatile__ ("# %[_SDT_A21]" :: [_SDT_A21] "nor" ((global_max_fast))); + global_max_fast = 1; +}