Patchwork [4.7] Avoid global state in ix86_handle_option

login
register
mail settings
Submitter Joseph S. Myers
Date March 2, 2011, 1:57 a.m.
Message ID <Pine.LNX.4.64.1103020154590.23754@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/85015/
State New
Headers show

Comments

Joseph S. Myers - March 2, 2011, 1:57 a.m.
This patch, for 4.7 and relative to a tree with
<http://gcc.gnu.org/ml/gcc-patches/2011-02/msg01709.html> applied,
stops the x86 handle_option hook from using global state.

Placing ix86_isa_flags_explicit in gcc_options isn't really ideal -
global_options_set.ix86_isa_flags would logically be better.  But the
way this value can be saved and restored is contrary to how the _set
structures are meant to be used and the logic here is complicated, so
I'm not trying to clean it up; this particular issue does not need to
be fixed for the multilibs changes that are the object of this patch
series.

The other oddity in ix86_handle_option is the OPT_m3dnowa case that
just returns false - that is, -m3dnowa is an option in the .opt file
that is never actually accepted.  It appears the purpose of this
option is to define a mask for a non-default variable, and the .opt
machinery doesn't currently having a way of defining such a mask
without an option to go with it.  So that case is left unchanged.

Bootstrapped with no regressions on x86_64-unknown-linux-gnu.  Will
commit to trunk for 4.7 in the absence of target maintainer
objections.

2011-03-01  Joseph Myers  <joseph@codesourcery.com>

	* config/i386/i386.c (ix86_isa_flags_explicit): Remove.
	(ix86_handle_option): Access ix86_isa_flags and
	ix86_isa_flags_explicit via opts pointer.  Don't assert that
	global structures are in use.
	(ix86_function_specific_save, ix86_function_specific_restore):
	Update ix86_isa_flags_explicit field name.
	* config/i386/i386.opt (ix86_isa_flags_explicit): New Variable
	entry.
	(ix86_isa_flags_explicit): Rename TargetSave entry to
	x_ix86_isa_flags_explicit.

Patch

diff -rupN --exclude=.svn gcc-mainline-1/gcc/config/i386/i386.c gcc-mainline/gcc/config/i386/i386.c
--- gcc-mainline-1/gcc/config/i386/i386.c	2011-02-23 08:49:29.000000000 -0800
+++ gcc-mainline/gcc/config/i386/i386.c	2011-03-01 11:33:21.000000000 -0800
@@ -2481,10 +2481,6 @@  static enum calling_abi ix86_function_ab
 static int ix86_tune_defaulted;
 static int ix86_arch_specified;
 
-/* A mask of ix86_isa_flags that includes bit X if X
-   was set or cleared on the command line.  */
-static int ix86_isa_flags_explicit;
-
 /* Define a set of ISAs which are available when a given ISA is
    enabled.  MMX and SSE ISAs are handled separately.  */
 
@@ -2684,41 +2680,39 @@  ix86_using_red_zone (void)
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-ix86_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
+ix86_handle_option (struct gcc_options *opts,
+		    struct gcc_options *opts_set ATTRIBUTE_UNUSED,
 		    const struct cl_decoded_option *decoded,
 		    location_t loc ATTRIBUTE_UNUSED)
 {
   size_t code = decoded->opt_index;
   int value = decoded->value;
 
-  gcc_assert (opts == &global_options);
-  gcc_assert (opts_set == &global_options_set);
-
   switch (code)
     {
     case OPT_mmmx:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_MMX_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_MMX_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_MMX_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_MMX_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_MMX_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_MMX_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_MMX_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_MMX_UNSET;
 	}
       return true;
 
     case OPT_m3dnow:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_3DNOW_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_3DNOW_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_3DNOW_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_3DNOW_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_3DNOW_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_3DNOW_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_3DNOW_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_3DNOW_UNSET;
 	}
       return true;
 
@@ -2728,335 +2722,335 @@  ix86_handle_option (struct gcc_options *
     case OPT_msse:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_SSE_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_SSE_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE_UNSET;
 	}
       return true;
 
     case OPT_msse2:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_SSE2_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE2_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE2_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE2_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_SSE2_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE2_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE2_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE2_UNSET;
 	}
       return true;
 
     case OPT_msse3:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_SSE3_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE3_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE3_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE3_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_SSE3_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE3_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE3_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE3_UNSET;
 	}
       return true;
 
     case OPT_mssse3:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_SSSE3_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSSE3_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSSE3_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSSE3_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_SSSE3_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSSE3_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSSE3_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSSE3_UNSET;
 	}
       return true;
 
     case OPT_msse4_1:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_SSE4_1_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_1_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE4_1_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_1_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_SSE4_1_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_1_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE4_1_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_1_UNSET;
 	}
       return true;
 
     case OPT_msse4_2:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_SSE4_2_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_2_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE4_2_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_2_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_SSE4_2_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_2_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE4_2_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_2_UNSET;
 	}
       return true;
 
     case OPT_mavx:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_AVX_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_AVX_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_AVX_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AVX_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_AVX_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_AVX_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_AVX_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AVX_UNSET;
 	}
       return true;
 
     case OPT_mfma:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_FMA_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_FMA_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_FMA_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_FMA_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA_UNSET;
 	}
       return true;
 
     case OPT_msse4:
-      ix86_isa_flags |= OPTION_MASK_ISA_SSE4_SET;
-      ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_SET;
+      opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE4_SET;
+      opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_SET;
       return true;
 
     case OPT_mno_sse4:
-      ix86_isa_flags &= ~OPTION_MASK_ISA_SSE4_UNSET;
-      ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_UNSET;
+      opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE4_UNSET;
+      opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_UNSET;
       return true;
 
     case OPT_msse4a:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_SSE4A_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4A_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SSE4A_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4A_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_SSE4A_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4A_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SSE4A_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4A_UNSET;
 	}
       return true;
 
     case OPT_mfma4:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_FMA4_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA4_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_FMA4_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA4_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_FMA4_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA4_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_FMA4_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA4_UNSET;
 	}
       return true;
 
    case OPT_mxop:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_XOP_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_XOP_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_XOP_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_XOP_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_XOP_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_XOP_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_XOP_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_XOP_UNSET;
 	}
       return true;
 
    case OPT_mlwp:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_LWP_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_LWP_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_LWP_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_LWP_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_LWP_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_LWP_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_LWP_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_LWP_UNSET;
 	}
       return true;
 
     case OPT_mabm:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_ABM_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_ABM_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_ABM_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_ABM_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_ABM_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_ABM_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_ABM_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_ABM_UNSET;
 	}
       return true;
 
     case OPT_mbmi:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_BMI_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_BMI_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_BMI_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_BMI_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_BMI_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_BMI_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_BMI_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_BMI_UNSET;
 	}
       return true;
 
     case OPT_mtbm:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_TBM_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_TBM_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_TBM_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_TBM_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_TBM_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_TBM_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_TBM_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_TBM_UNSET;
 	}
       return true;
 
     case OPT_mpopcnt:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_POPCNT_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_POPCNT_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_POPCNT_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_POPCNT_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_POPCNT_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_POPCNT_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_POPCNT_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_POPCNT_UNSET;
 	}
       return true;
 
     case OPT_msahf:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_SAHF_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_SAHF_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SAHF_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SAHF_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_SAHF_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_SAHF_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SAHF_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SAHF_UNSET;
 	}
       return true;
 
     case OPT_mcx16:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_CX16_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_CX16_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_CX16_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_CX16_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_CX16_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_CX16_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_CX16_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_CX16_UNSET;
 	}
       return true;
 
     case OPT_mmovbe:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_MOVBE_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_MOVBE_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_MOVBE_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_MOVBE_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_MOVBE_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_MOVBE_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_MOVBE_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_MOVBE_UNSET;
 	}
       return true;
 
     case OPT_mcrc32:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_CRC32_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_CRC32_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_CRC32_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_CRC32_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_CRC32_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_CRC32_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_CRC32_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_CRC32_UNSET;
 	}
       return true;
 
     case OPT_maes:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_AES_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_AES_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_AES_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AES_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_AES_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_AES_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_AES_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AES_UNSET;
 	}
       return true;
 
     case OPT_mpclmul:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_PCLMUL_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_PCLMUL_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_PCLMUL_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_PCLMUL_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_PCLMUL_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_PCLMUL_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_PCLMUL_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_PCLMUL_UNSET;
 	}
       return true;
 
     case OPT_mfsgsbase:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_FSGSBASE_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_FSGSBASE_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_FSGSBASE_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FSGSBASE_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_FSGSBASE_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_FSGSBASE_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_FSGSBASE_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_FSGSBASE_UNSET;
 	}
       return true;
 
     case OPT_mrdrnd:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_RDRND_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_RDRND_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_RDRND_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_RDRND_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_RDRND_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_RDRND_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_RDRND_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_RDRND_UNSET;
 	}
       return true;
 
     case OPT_mf16c:
       if (value)
 	{
-	  ix86_isa_flags |= OPTION_MASK_ISA_F16C_SET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_F16C_SET;
+	  opts->x_ix86_isa_flags |= OPTION_MASK_ISA_F16C_SET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_F16C_SET;
 	}
       else
 	{
-	  ix86_isa_flags &= ~OPTION_MASK_ISA_F16C_UNSET;
-	  ix86_isa_flags_explicit |= OPTION_MASK_ISA_F16C_UNSET;
+	  opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_F16C_UNSET;
+	  opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_F16C_UNSET;
 	}
       return true;
 
@@ -4417,7 +4411,7 @@  ix86_function_specific_save (struct cl_t
   ptr->branch_cost = ix86_branch_cost;
   ptr->tune_defaulted = ix86_tune_defaulted;
   ptr->arch_specified = ix86_arch_specified;
-  ptr->ix86_isa_flags_explicit = ix86_isa_flags_explicit;
+  ptr->x_ix86_isa_flags_explicit = ix86_isa_flags_explicit;
   ptr->ix86_target_flags_explicit = target_flags_explicit;
 
   /* The fields are char but the variables are not; make sure the
@@ -4446,7 +4440,7 @@  ix86_function_specific_restore (struct c
   ix86_branch_cost = ptr->branch_cost;
   ix86_tune_defaulted = ptr->tune_defaulted;
   ix86_arch_specified = ptr->arch_specified;
-  ix86_isa_flags_explicit = ptr->ix86_isa_flags_explicit;
+  ix86_isa_flags_explicit = ptr->x_ix86_isa_flags_explicit;
   target_flags_explicit = ptr->ix86_target_flags_explicit;
 
   /* Recreate the arch feature tests if the arch changed */
diff -rupN --exclude=.svn gcc-mainline-1/gcc/config/i386/i386.opt gcc-mainline/gcc/config/i386/i386.opt
--- gcc-mainline-1/gcc/config/i386/i386.opt	2011-01-26 16:28:19.000000000 -0800
+++ gcc-mainline/gcc/config/i386/i386.opt	2011-03-01 11:32:56.000000000 -0800
@@ -23,6 +23,11 @@ 
 Variable
 int ix86_isa_flags = TARGET_64BIT_DEFAULT | TARGET_SUBTARGET_ISA_DEFAULT
 
+; A mask of ix86_isa_flags that includes bit X if X was set or cleared
+; on the command line.
+Variable
+int ix86_isa_flags_explicit
+
 ;; Definitions to add to the cl_target_option structure
 ;; -march= processor
 TargetSave
@@ -46,7 +51,7 @@  unsigned char branch_cost
 
 ;; which flags were passed by the user
 TargetSave
-int ix86_isa_flags_explicit
+int x_ix86_isa_flags_explicit
 
 ;; which flags were passed by the user
 TargetSave