aboutsummaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2011-02-08 17:41:00 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-02-08 17:41:00 +0000
commit5e46b0c65bad1b8569d6005f86465ecb020a6715 (patch)
tree8fc008788b764f0ba0d67864e8566ca53db122f5 /gcc/opts.c
parent32243d46707ec76650af0e33cdf77ee3fc3600eb (diff)
downloadgcc-5e46b0c65bad1b8569d6005f86465ecb020a6715.zip
gcc-5e46b0c65bad1b8569d6005f86465ecb020a6715.tar.gz
gcc-5e46b0c65bad1b8569d6005f86465ecb020a6715.tar.bz2
common.opt (fcx-limited-range): Add SetByCombined flag.
* common.opt (fcx-limited-range): Add SetByCombined flag. (ffinite-math-only, fmath-errno, frounding-math): Likewise. (fsignaling-nans, fsigned-zeros, ftrapping-math): Likewise. (fassociative-math, freciprocal-math): Likewise. (funsafe-math-optimizations): Likewise. * opth-gen.awk: Handle SetByCombined. * optc-gen.awk: Likewise. * opts.c (set_fast_math_flags): Don't override flag if set by frontend. (set_unsafe_math_optimizations_flags): Likewise. * doc/options.texi (Option properties): Document SetByCombined. From-SVN: r169930
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index 9a3fb13..8ca9c67 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1,5 +1,5 @@
/* Command line option handling.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Neil Booth.
@@ -1757,15 +1757,23 @@ set_Wstrict_aliasing (struct gcc_options *opts, int onoff)
static void
set_fast_math_flags (struct gcc_options *opts, int set)
{
- opts->x_flag_unsafe_math_optimizations = set;
- set_unsafe_math_optimizations_flags (opts, set);
- opts->x_flag_finite_math_only = set;
- opts->x_flag_errno_math = !set;
+ if (!opts->frontend_set_flag_unsafe_math_optimizations)
+ {
+ opts->x_flag_unsafe_math_optimizations = set;
+ set_unsafe_math_optimizations_flags (opts, set);
+ }
+ if (!opts->frontend_set_flag_finite_math_only)
+ opts->x_flag_finite_math_only = set;
+ if (!opts->frontend_set_flag_errno_math)
+ opts->x_flag_errno_math = !set;
if (set)
{
- opts->x_flag_signaling_nans = 0;
- opts->x_flag_rounding_math = 0;
- opts->x_flag_cx_limited_range = 1;
+ if (!opts->frontend_set_flag_signaling_nans)
+ opts->x_flag_signaling_nans = 0;
+ if (!opts->frontend_set_flag_rounding_math)
+ opts->x_flag_rounding_math = 0;
+ if (!opts->frontend_set_flag_cx_limited_range)
+ opts->x_flag_cx_limited_range = 1;
}
}
@@ -1774,10 +1782,14 @@ set_fast_math_flags (struct gcc_options *opts, int set)
static void
set_unsafe_math_optimizations_flags (struct gcc_options *opts, int set)
{
- opts->x_flag_trapping_math = !set;
- opts->x_flag_signed_zeros = !set;
- opts->x_flag_associative_math = set;
- opts->x_flag_reciprocal_math = set;
+ if (!opts->frontend_set_flag_trapping_math)
+ opts->x_flag_trapping_math = !set;
+ if (!opts->frontend_set_flag_signed_zeros)
+ opts->x_flag_signed_zeros = !set;
+ if (!opts->frontend_set_flag_associative_math)
+ opts->x_flag_associative_math = set;
+ if (!opts->frontend_set_flag_reciprocal_math)
+ opts->x_flag_reciprocal_math = set;
}
/* Return true iff flags in OPTS are set as if -ffast-math. */