https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89517

--- Comment #4 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Author: tnfchris
Date: Fri Jul 26 13:13:48 2019
New Revision: 273827

URL: https://gcc.gnu.org/viewcvs?rev=273827&root=gcc&view=rev
Log:
AArch64: Make processing less fragile in config.gcc

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.

gcc/ChangeLog:

        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.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config.gcc
    trunk/gcc/config/aarch64/aarch64-option-extensions.def

Reply via email to