From d4aa4f4b78fd35f3005943ee7a59468660504337 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 19 Jun 2009 17:56:01 +0000 Subject: [PATCH] i386.c (ix86_function_specific_save): Test that fields match values... * 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 | 6 ++++++ gcc/config/i386/i386.c | 14 ++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f4e7816bb451..695547c4618f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-06-19 Ian Lance Taylor + + * 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 * tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Handle diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 61774cc0fdf3..06ae734af301 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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 */