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: 333234 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40AB814008E for ; Tue, 25 Mar 2014 15:55:33 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=mKsG34AgSxUC+Ok9x NK49WgNJQ7JqzJJGby4Ir2hU0E92hywrnUT3rnTfcwnbNlaBccs71f+s7XyIvZFs 7ovy0p83aSYBdxlKPMovFHef1vSSUw2N7xN/fC+J/NKzPenDyz1meqLfqV0CbzvU 3dtMgwlU3NbT1kvLCb4LY0oFyI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=1ZrWTsBC8mWdj6MjNOTTQFg tOwU=; b=mN98k0pHb5ILbPjZWDqSKcy2/BnK7xLO5HHM4LfcAiaTFHwLKq8y3N8 2im2ZJDVa9VdSiLA1+VaWGo1WeHFY6defzMKWXB16NXlMmW/kVjiRKPE9fk1Ea9x Hz/OeXNNdDnILfXpAhNNaXoe+Cf73ElshQMW9N0ollWWdlBUuF7I= Received: (qmail 29946 invoked by alias); 25 Mar 2014 04:55:24 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk 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 Authentication-Results: sourceware.org; auth=none 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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=WDaMSz14ONdFxM7BxMmsK644pMpGaT7cdDGtIFNLV5o=; b=A6pL4fprgfgU+IPff5zMHsDNS1JoI8DhgsKD3yKvKqcd0+GCzHSv0+ahXdhr8iE4cw I5uYCGnlDWE5TM6sRYUGCl1JCuFMlh0iPByByhPyStqXCJV/TKG/KwCUzm7t6SPb64Q6 8WlpAyHPLtfx3FfS1hgNokVRzC6oRnzXWPz0f0iGAfSZhlKZ5R4klw41ZIeYH3fiB1Ji AolvarissqBiGlKI6RhANfI7evTyJPg24mgpabmYYtyJ/2jjH7bc91lsolH8XF05u3nL iHQ7eOxrOOTy9l09qxO1iYti0ecNSFoI+sp4ahQkQNCqJROdvv+vtUeo70ez1+0wa4e1 377g== X-Gm-Message-State: ALoCoQm32DiZAJmqIgTvXvcXKQJYQvHBC7+7kc/37Vj4zIGrfynAJ7zugUltigzTTHiMq2LJ1lcc 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 >> 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; +}