From: Michael Meissner Date: Tue, 2 Oct 2012 18:08:02 +0000 (+0000) Subject: If no -mcpu= or implicit cpu via --with-cpu= configure option, inhereit... X-Git-Tag: misc/gccgo-go1_1_2~468 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59a2dfe8d754913ff356c83e1c9a7106a69aad11;p=thirdparty%2Fgcc.git If no -mcpu= or implicit cpu via --with-cpu= configure option, inhereit all TARGET_DEFAULT bits. From-SVN: r191993 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 32dce2df16c3..0a6a13953fb9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-10-02 Michael Meissner + + * config/rs6000/rs6000.c (rs6000_option_override_internal): If + -mcpu= is not specified and the compiler is not configured + using --with-cpu=, use the bits from the TARGET_DEFAULT to + set the initial options. + 2012-10-02 Sharad Singhai PR testsuite/54772 diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index a3f99092900e..3e3d55324e9a 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -2446,21 +2446,34 @@ rs6000_option_override_internal (bool global_init_p) rs6000_cpu_index = cpu_index = main_target_opt->x_rs6000_cpu_index; have_cpu = true; } + else if (implicit_cpu) + { + rs6000_cpu_index = cpu_index = rs6000_cpu_name_lookup (implicit_cpu); + have_cpu = true; + } else { - const char *default_cpu = - (implicit_cpu ? implicit_cpu - : (TARGET_POWERPC64 ? "powerpc64" : "powerpc")); - + const char *default_cpu = (TARGET_POWERPC64 ? "powerpc64" : "powerpc"); rs6000_cpu_index = cpu_index = rs6000_cpu_name_lookup (default_cpu); - have_cpu = implicit_cpu != 0; + have_cpu = false; } gcc_assert (cpu_index >= 0); - target_flags &= ~set_masks; - target_flags |= (processor_target_table[cpu_index].target_enable - & set_masks); + /* If we have a cpu, either through an explicit -mcpu= or if the + compiler was configured with --with-cpu=, replace all of the ISA bits + with those from the cpu, except for options that were explicitly set. If + we don't have a cpu, do not override the target bits set in + TARGET_DEFAULT. */ + if (have_cpu) + { + target_flags &= ~set_masks; + target_flags |= (processor_target_table[cpu_index].target_enable + & set_masks); + } + else + target_flags |= (processor_target_table[cpu_index].target_enable + & ~target_flags_explicit); if (rs6000_tune_index >= 0) tune_index = rs6000_tune_index;