[arm] Generate a canonical form for -march

Programming / Compilers / GCC - rearnsha [138bc75d-0d04-0410-961f-82ee72b054a4] - 16 June 2017 17:04 EDT

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.

1588d60 [arm] Generate a canonical form for -march
gcc/ChangeLog | 13 ++
gcc/common/config/arm/arm-common.c | 354 +++++++++++++++++++++++++++++++++++++
gcc/config/arm/arm.h | 20 ++-
3 files changed, 386 insertions(+), 1 deletion(-)

Upstream: gcc.gnu.org

  • Share