rs6000: Initialise rs6000_cpu correctly (PR43871)
authorSegher Boessenkool <segher@kernel.crashing.org>
Thu, 7 Dec 2017 09:36:28 +0000 (10:36 +0100)
committerSegher Boessenkool <segher@gcc.gnu.org>
Thu, 7 Dec 2017 09:36:28 +0000 (10:36 +0100)
Finally, set rs6000_cpu based not on -mtune=, but only -mcpu= and the
defaults.

PR target/43871
* config/rs6000/rs6000.c (rs6000_option_override_internal): Set
rs6000_cpu to the given -mcpu=, or to the default processor.

From-SVN: r255464

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index a12df83a5401ec81f268fe5aa95afe6a4f358632..dab026a0c8385b0f75dbc3b7766db296f9f33824 100644 (file)
@@ -1,3 +1,9 @@
+2017-12-07  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       PR target/43871
+       * config/rs6000/rs6000.c (rs6000_option_override_internal): Set
+       rs6000_cpu to the given -mcpu=, or to the default processor.
+
 2017-12-07  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * config/rs6000/rs6000.h (rs6000_cpu_attr): Delete.
index f4028f17fe43820b4c3c7c43b9c46ebdc477eba9..83aa428c32c8645a04a0bea104517798b45bedbd 100644 (file)
@@ -4184,8 +4184,11 @@ rs6000_option_override_internal (bool global_init_p)
          }
     }
 
-  gcc_assert (tune_index >= 0);
-  rs6000_cpu = processor_target_table[tune_index].processor;
+  if (cpu_index >= 0)
+    rs6000_cpu = processor_target_table[cpu_index].processor;
+  else
+    rs6000_cpu = TARGET_POWERPC64 ? PROCESSOR_DEFAULT64 : PROCESSOR_DEFAULT;
+
   gcc_assert (tune_index >= 0);
   rs6000_tune = processor_target_table[tune_index].processor;