[PATCH][GCC][AArch64] Make processing less fragile in config.gcc

Kyrill Tkachov kyrylo.tkachov@foss.arm.com
Fri May 24 16:23:00 GMT 2019


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  <tamar.christina@arm.com>
>
>         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



>
> -- 



More information about the Gcc-patches mailing list