rs6000: Set rs6000_cpu correctly (PR43871)
authorSegher Boessenkool <segher@kernel.crashing.org>
Sat, 2 Dec 2017 01:23:41 +0000 (02:23 +0100)
committerSegher Boessenkool <segher@gcc.gnu.org>
Sat, 2 Dec 2017 01:23:41 +0000 (02:23 +0100)
We set rs6000_cpu based on tune_index, but it should be cpu_index.
This patch fixes it.

PR target/43871
* config/rs6000/rs6000.c (rs6000_option_override_internal): Set
rs6000_cpu based on cpu_index, not tune_index.

From-SVN: r255349

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

index 11ccbfb91c25c5ebb9bdc28c648a0fb501c14459..da0c32e9a6d8dd90f190af6f850475661ac53267 100644 (file)
@@ -1,3 +1,9 @@
+2017-12-01  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       PR target/43871
+       * config/rs6000/rs6000.c (rs6000_option_override_internal): Set
+       rs6000_cpu based on cpu_index, not tune_index.
+
 2017-12-01  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * final.c (output_asm_name): Print insn_cost.  Shorten output.  Print
index 5f5f6d51ef85519257bd74bfd7831cc1b07bdaa2..2adf406aac7bef86e465a2879761240b1687fd12 100644 (file)
@@ -4184,8 +4184,8 @@ rs6000_option_override_internal (bool global_init_p)
          }
     }
 
-  gcc_assert (tune_index >= 0);
-  rs6000_cpu = processor_target_table[tune_index].processor;
+  gcc_assert (cpu_index >= 0);
+  rs6000_cpu = processor_target_table[cpu_index].processor;
 
   if (rs6000_cpu == PROCESSOR_PPCE300C2 || rs6000_cpu == PROCESSOR_PPCE300C3
       || rs6000_cpu == PROCESSOR_PPCE500MC || rs6000_cpu == PROCESSOR_PPCE500MC64