From: Segher Boessenkool Date: Thu, 7 Dec 2017 09:36:28 +0000 (+0100) Subject: rs6000: Initialise rs6000_cpu correctly (PR43871) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d78d986bfa059f3ad53c0be027ff8d3200404fec;p=gcc.git rs6000: Initialise rs6000_cpu correctly (PR43871) 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a12df83a540..dab026a0c83 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-12-07 Segher Boessenkool + + 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 * config/rs6000/rs6000.h (rs6000_cpu_attr): Delete. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index f4028f17fe4..83aa428c32c 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -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;