We set rs6000_cpu based on tune_index, but it should be cpu_index.
This patch fixes it.

Tested on powerpc64-linux {-m32,-m64}.  I'll commit this later today,
and schedule backports for next week.  Unless it is all terribly wrong
and someone complains :-)


Segher


2017-11-30  Segher Boessenkool  <seg...@kernel.crashing.org>

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

---
 gcc/config/rs6000/rs6000.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 9929a45..9c0df9a 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4183,8 +4183,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
-- 
1.8.3.1

Reply via email to