From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73159 invoked by alias); 24 May 2019 16:23: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 73151 invoked by uid 89); 24 May 2019 16:23:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 spammy=fragile, HX-Languages-Length:1704, Regtested, eventual X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 May 2019 16:23:48 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A7F9F80D; Fri, 24 May 2019 09:23:46 -0700 (PDT) Received: from [10.2.206.47] (e120808-lin.cambridge.arm.com [10.2.206.47]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 90AE13F575; Fri, 24 May 2019 09:23:45 -0700 (PDT) Subject: Re: [PATCH][GCC][AArch64] Make processing less fragile in config.gcc To: Tamar Christina , "gcc-patches@gcc.gnu.org" Cc: nd , James Greenhalgh , Richard Earnshaw , Marcus Shawcroft References: <20190521170022.GA10685@arm.com> From: Kyrill Tkachov Message-ID: <0f7d9eaf-ad81-25ad-9c8e-616c791f3168@foss.arm.com> Date: Fri, 24 May 2019 16:23:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190521170022.GA10685@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2019-05/txt/msg01711.txt.bz2 Hi Tamar, On 5/21/19 6:00 PM, Tamar Christina wrote: > Hi All, > > Due to config.gcc all the options need to be on one line because of > the grep > lines which would select only the first line of the option. > > This causes it not to select the right bits on options that are spread > over > multiple lines when the --with-arch configure option is used.  The > issue happens > silently and you just get a compiler with an incorrect set of default > flags. > > The current rules are quite rigid: > >    1) No space between the AARCH64_OPT_EXTENSION and the opening (. >    2) No space between the opening ( and the extension name. >    3) No space after the extension name before the ,. >    4) Spaces are only allowed after a , and around |. > > This patch makes this a lot less fragile by using the C pre-processor > to flatten > the list and then provides much more flexible regex using group > matching to > process the options instead of string replacement.  This removes all the > restrictions above and makes the code a bit more readable. > > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. > > Ok for trunk? and for eventual backport? > > Thanks, > Tamar > > gcc/ChangeLog: > > 2019-05-21  Tamar Christina  > >         PR target/89517 >         * config.gcc: Relax parsing of AARCH64_OPT_EXTENSION. >         * config/aarch64/aarch64-option-extensions.def: Add new comments >         and restore easier to read options. LGTM FWIW, but I'm afraid you'll need to rebase it over the recent addition of sve2 family to the extensions. Thanks, Kyrill > > --