diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2017-12-07 10:36:28 +0100 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2017-12-07 10:36:28 +0100 |
commit | d78d986bfa059f3ad53c0be027ff8d3200404fec (patch) | |
tree | 777389d7d15cb706975c7fbd1517f7159163ee5f /gcc | |
parent | 39f88700226c8d1f91f4a4ac9d557e721618e87f (diff) | |
download | gcc-d78d986bfa059f3ad53c0be027ff8d3200404fec.zip gcc-d78d986bfa059f3ad53c0be027ff8d3200404fec.tar.gz gcc-d78d986bfa059f3ad53c0be027ff8d3200404fec.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a12df83..dab026a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2017-12-07 Segher Boessenkool <segher@kernel.crashing.org> + 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 <segher@kernel.crashing.org> + * config/rs6000/rs6000.h (rs6000_cpu_attr): Delete. * config/rs6000/rs6000.c (rs6000_variable_issue_1): Use rs6000_tune instead of rs6000_cpu_attr. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index f4028f1..83aa428 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; |