aboutsummaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authorRevital Eres <eres@il.ibm.com>2007-09-04 12:11:11 +0000
committerRevital Eres <revitale@gcc.gnu.org>2007-09-04 12:11:11 +0000
commita1a826110720eda37c73f829daa4ee243ee953f5 (patch)
tree67cecf461cc930540853bd8eb0d4f19b3b21b0ce /gcc/opts.c
parentcea79118fa00faf811626e67209ca666468bc76f (diff)
downloadgcc-a1a826110720eda37c73f829daa4ee243ee953f5.zip
gcc-a1a826110720eda37c73f829daa4ee243ee953f5.tar.gz
gcc-a1a826110720eda37c73f829daa4ee243ee953f5.tar.bz2
Add new fp flags: -fassociative-math and -freciprocal-math
Co-Authored-By: R. Clint Whaley <whaley@cs.utsa.edu> Co-Authored-By: Richard Guenther <rguenther@suse.de> From-SVN: r128075
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index dc5a26d..735f942 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1559,6 +1559,10 @@ common_handle_option (size_t scode, const char *arg, int value,
set_fast_math_flags (value);
break;
+ case OPT_funsafe_math_optimizations:
+ set_unsafe_math_optimizations_flags (value);
+ break;
+
case OPT_ffixed_:
fix_register (arg, 1, 1);
break;
@@ -1857,6 +1861,8 @@ set_fast_math_flags (int set)
{
flag_trapping_math = !set;
flag_unsafe_math_optimizations = set;
+ flag_associative_math = set;
+ flag_reciprocal_math = set;
flag_finite_math_only = set;
flag_signed_zeros = !set;
flag_errno_math = !set;
@@ -1868,6 +1874,15 @@ set_fast_math_flags (int set)
}
}
+/* When -funsafe-math-optimizations is set the following
+ flags are set as well. */
+void
+set_unsafe_math_optimizations_flags (int set)
+{
+ flag_reciprocal_math = set;
+ flag_associative_math = set;
+}
+
/* Return true iff flags are set as if -ffast-math. */
bool
fast_math_flags_set_p (void)