]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386.c (ix86_function_specific_save): Test that fields match values...
authorIan Lance Taylor <iant@google.com>
Fri, 19 Jun 2009 17:56:01 +0000 (17:56 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 19 Jun 2009 17:56:01 +0000 (17:56 +0000)
* config/i386/i386.c (ix86_function_specific_save): Test that
fields match values, rather than testing the values are in a
certain range.

From-SVN: r148721

gcc/ChangeLog
gcc/config/i386/i386.c

index f4e7816bb451705d2319ff4bbe1b4f1ee42f46ce..695547c4618f9504c2276b5c782cb4ca60478b64 100644 (file)
@@ -1,3 +1,9 @@
+2009-06-19  Ian Lance Taylor  <iant@google.com>
+
+       * config/i386/i386.c (ix86_function_specific_save): Test that
+       fields match values, rather than testing the values are in a
+       certain range.
+
 2009-06-19  Richard Guenther  <rguenther@suse.de>
 
        * tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Handle
index 61774cc0fdf32da31b6b74163efe7c877078b63e..06ae734af3010670cb8ceb5528845610f2bf79d1 100644 (file)
@@ -3424,12 +3424,6 @@ override_options (bool main_args_p)
 static void
 ix86_function_specific_save (struct cl_target_option *ptr)
 {
-  gcc_assert (IN_RANGE (ix86_arch, 0, 255));
-  gcc_assert (IN_RANGE (ix86_schedule, 0, 255));
-  gcc_assert (IN_RANGE (ix86_tune, 0, 255));
-  gcc_assert (IN_RANGE (ix86_fpmath, 0, 255));
-  gcc_assert (IN_RANGE (ix86_branch_cost, 0, 255));
-
   ptr->arch = ix86_arch;
   ptr->schedule = ix86_schedule;
   ptr->tune = ix86_tune;
@@ -3439,6 +3433,14 @@ ix86_function_specific_save (struct cl_target_option *ptr)
   ptr->arch_specified = ix86_arch_specified;
   ptr->ix86_isa_flags_explicit = ix86_isa_flags_explicit;
   ptr->target_flags_explicit = target_flags_explicit;
+
+  /* The fields are char but the variables are not; make sure the
+     values fit in the fields.  */
+  gcc_assert (ptr->arch == ix86_arch);
+  gcc_assert (ptr->schedule == ix86_schedule);
+  gcc_assert (ptr->tune == ix86_tune);
+  gcc_assert (ptr->fpmath == ix86_fpmath);
+  gcc_assert (ptr->branch_cost == ix86_branch_cost);
 }
 
 /* Restore the current options */