[arm] Generate a canonical form for -march
authorRichard Earnshaw <rearnsha@arm.com>
Fri, 16 Jun 2017 21:04:02 +0000 (21:04 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Fri, 16 Jun 2017 21:04:02 +0000 (21:04 +0000)
commit0b97b8f84a904dff92284e9899f53f9a1dbc177b
treeb92f389b79477164f5ea6568c20ac00a7b18b139
parenta4af8a1046d3c77ee1152c9dad08329a0dd51f49
[arm] Generate a canonical form for -march

This patch uses the driver and some spec rewrite rules to generate a
canonicalized form of the -march= option.  We want to do this for
several reasons, all relating to making multi-lib selection sane.

1) It can remove redundant extension options to produce a minimal
list.

2) The general syntax of the option permits a plethora of features,
these are permitted in any order.  Canonicalization ensures that there
is a single ordering of the options that are needed.

3) It can use additional options to remove extensions that aren't
relevant, such as removing all features that relate to the FPU when
use of that is disabled.

Once we have this information in a sensible form the multilib rules
can be vastly simplified making for much more understandable Makefile
fragments.

* common/config/arm/arm-common.c: Define INCLUDE_LIST.
(configargs.h): Include it.
(arm_print_hint_for_fpu_option): New function.
(arm_parse_fpu_option): New function.
(candidate_extension): New class.
(arm_canon_for_multilib): New function.
* config/arm/arm.h (CANON_ARCH_SPEC_FUNCTION): New macro.
(EXTRA_SPEC_FUNCTIONS): Add CANON_ARCH_SPEC_FUNCTION.
(ARCH_CANONICAL_SPECS): New macro.
(DRIVER_SELF_SPECS): Add ARCH_CANONICAL_SPECS.

From-SVN: r249292
gcc/ChangeLog
gcc/common/config/arm/arm-common.c
gcc/config/arm/arm.h