diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index 605d35893f9..3bfbb4eac21 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -3702,7 +3702,7 @@ rs6000_option_override_internal (bool global_init_p) else { /* PowerPC 64-bit LE requires at least ISA 2.07. */ - const char *default_cpu = (!TARGET_POWERPC64 + const char *default_cpu = (!TARGET_POWERPC64 && TARGET_32BIT ? "powerpc" : (BYTES_BIG_ENDIAN ? "powerpc64" @@ -3713,6 +3713,26 @@ rs6000_option_override_internal (bool global_init_p) rs6000_isa_flags |= (flags & ~rs6000_isa_flags_explicit); } + /* With option powerpc64 specified explicitly (either on or off), even if + being compiled for 64 bit we don't need to check if it's disabled here, + since subtargets will check and raise an error message if necessary + later. But without option powerpc64 specified explicitly, we need to + ensure powerpc64 enabled for 64 bit and disabled on those OSes with + OS_MISSING_POWERPC64, since they don't support saving the high part of + 64-bit registers on context switch. */ + if (!(rs6000_isa_flags_explicit & OPTION_MASK_POWERPC64)) + { + if (TARGET_64BIT) + /* Make sure we always enable it by default for 64 bit. */ + rs6000_isa_flags |= OPTION_MASK_POWERPC64; +#ifdef OS_MISSING_POWERPC64 + else if (OS_MISSING_POWERPC64) + /* It's unexpected to have OPTION_MASK_POWERPC64 on for OSes which + miss powerpc64 support, so disable it. */ + rs6000_isa_flags &= ~OPTION_MASK_POWERPC64; +#endif + } + if (rs6000_tune_index >= 0) tune_index = rs6000_tune_index; else if (cpu_index >= 0) @@ -3748,26 +3768,6 @@ rs6000_option_override_internal (bool global_init_p) error ("AltiVec not supported in this target"); } - /* With option powerpc64 specified explicitly (either on or off), even if - being compiled for 64 bit we don't need to check if it's disabled here, - since subtargets will check and raise an error message if necessary - later. But without option powerpc64 specified explicitly, we need to - ensure powerpc64 enabled for 64 bit and disabled on those OSes with - OS_MISSING_POWERPC64, since they don't support saving the high part of - 64-bit registers on context switch. */ - if (!(rs6000_isa_flags_explicit & OPTION_MASK_POWERPC64)) - { - if (TARGET_64BIT) - /* Make sure we always enable it by default for 64 bit. */ - rs6000_isa_flags |= OPTION_MASK_POWERPC64; -#ifdef OS_MISSING_POWERPC64 - else if (OS_MISSING_POWERPC64) - /* It's unexpected to have OPTION_MASK_POWERPC64 on for OSes which - miss powerpc64 support, so disable it. */ - rs6000_isa_flags &= ~OPTION_MASK_POWERPC64; -#endif - } - /* If we are optimizing big endian systems for space, use the load/store multiple instructions. */ if (BYTES_BIG_ENDIAN && optimize_size)