From 81094bcb458cd005474156b5e0bc0c7c72387bbc Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Sat, 2 Dec 2017 02:23:41 +0100 Subject: 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(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 11ccbfb..da0c32e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 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 which_alternative instead of which_alternative + 1. (output_asm_insn): Print an extra tab if the template is short. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 5f5f6d5..2adf406 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 -- cgit v1.1