[ARM] PR82175 - fix -mcpu=native not working correctly.
authorRichard Earnshaw <rearnsha@arm.com>
Tue, 26 Sep 2017 09:33:49 +0000 (09:33 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Tue, 26 Sep 2017 09:33:49 +0000 (09:33 +0000)
The new option processing machinery relies on %< rules in the specs to
suppress options that are rewritten.  Suppression appears to be a two
phase process where the option is partially suppressed when %< is
processed and then fully suppressed at the end of the string.  Strings
are separated by commas and there can be multiple strings used to form
DRIVER_SELF_SPECS.

The fix in this case is to separate the driver self specs for ARM into
separate rules as described; this forces the -m{cpu,tune,arch}=native
options to be properly removed before proceeding to the next rule set.

PR target/82175
* config/arm/arm.h (DRIVER_SELF_SPECS): Separate sub-rules with commas.

From-SVN: r253189

gcc/ChangeLog
gcc/config/arm/arm.h

index 7c6d7dc..5e7f82d 100644 (file)
@@ -1,3 +1,8 @@
+2017-09-26  Richard Earnshaw  <rearnsha@arm.com>
+
+       PR target/82175
+       * config/arm/arm.h (DRIVER_SELF_SPECS): Separate sub-rules with commas.
+
 2017-09-26  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/82320
index c71ad5c..a3ca800 100644 (file)
@@ -2228,9 +2228,12 @@ const char *arm_be8_option (int argc, const char **argv);
   "                     %{mfloat-abi=*: abi %*}"       \
   "                     %<march=*) "
 
+/* Complete set of specs for the driver.  Commas separate the
+   individual rules so that any option suppression (%<opt...)is
+   completed before starting subsequent rules.  */
 #define DRIVER_SELF_SPECS                      \
-  MCPU_MTUNE_NATIVE_SPECS                      \
-  TARGET_MODE_SPECS                            \
+  MCPU_MTUNE_NATIVE_SPECS,                     \
+  TARGET_MODE_SPECS,                           \
   ARCH_CANONICAL_SPECS
 
 #define TARGET_SUPPORTS_WIDE_INT 1