The following patch fixes a testsuite failure due to the fact that
-mcpu=power8 was turning on the new flags such as power8-vector, which
would then result in the VSX flag being turned back on after it was
previously turned off due to a conflicting option such as -msoft-float.
Bootstrap/regtest with no new regressions, ok for trunk?
-Pat
2013-07-18 Pat Haugen <pthau...@us.ibm.com>
* config/rs6000/rs6000.c (rs6000_option_override_internal):
Adjust flag
interaction for new Power8 flags and VSX.
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c (revision 200903)
+++ gcc/config/rs6000/rs6000.c (working copy)
@@ -2952,7 +2952,10 @@ rs6000_option_override_internal (bool gl
if (rs6000_isa_flags_explicit & OPTION_MASK_VSX)
msg = N_("-mvsx requires hardware floating point");
else
- rs6000_isa_flags &= ~ OPTION_MASK_VSX;
+ {
+ rs6000_isa_flags &= ~ OPTION_MASK_VSX;
+ rs6000_isa_flags_explicit |= OPTION_MASK_VSX;
+ }
}
else if (TARGET_PAIRED_FLOAT)
msg = N_("-mvsx and -mpaired are incompatible");
@@ -2980,6 +2983,16 @@ rs6000_option_override_internal (bool gl
}
}
+ /* If hard-float/altivec/vsx were explicitly turned off then don't allow
+ the -mcpu setting to enable options that conflict. */
+ if ((!TARGET_HARD_FLOAT || !TARGET_ALTIVEC || !TARGET_VSX)
+ && (rs6000_isa_flags_explicit & (OPTION_MASK_SOFT_FLOAT
+ | OPTION_MASK_ALTIVEC
+ | OPTION_MASK_VSX)) != 0)
+ rs6000_isa_flags &= ~((OPTION_MASK_P8_VECTOR | OPTION_MASK_CRYPTO
+ | OPTION_MASK_DIRECT_MOVE)
+ & ~rs6000_isa_flags_explicit);
+
if (TARGET_DEBUG_REG || TARGET_DEBUG_TARGET)
rs6000_print_isa_options (stderr, 0, "before defaults", rs6000_isa_flags);