From 81094bcb458cd005474156b5e0bc0c7c72387bbc Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Sat, 2 Dec 2017 02:23:41 +0100 Subject: [PATCH] rs6000: Set rs6000_cpu correctly (PR43871) 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 | 6 ++++++ gcc/config/rs6000/rs6000.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 11ccbfb91c2..da0c32e9a6d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-12-01 Segher Boessenkool + + 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 * final.c (output_asm_name): Print insn_cost. Shorten output. Print diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 5f5f6d51ef8..2adf406aac7 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -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 -- 2.30.2