summaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authortoon <toon@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-30 22:23:26 +0000
committertoon <toon@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-30 22:23:26 +0000
commit7eece8c3c9ac71e657645258b0c8ad99699df1ed (patch)
treede115f5445a03103a3fc5ea6fddfa87706ee7d4e /gcc/toplev.c
parent95c02608654896d12cb97aaae32fb52183b263c9 (diff)
downloadgcc-7eece8c3c9ac71e657645258b0c8ad99699df1ed.tar.gz
2002-07-30 Toon Moene <toon@moene.indiv.nluug.nl>
* flags.h: Declare flag_finite_math_only. Use it in definition of HONOR_NANS and HONOR_INFINITIES. * c-common.c (cb_register_builtins): Emit __FINITE_MATH_ONLY__ when flag_finite_math_only is set. * combine.c (simplify_if_then_else): If flag_finite_math_only is set, a == b has a definite value. * toplev.c: Initialize flag_finite_math_only. (set_flags_fast_math): Set it on -ffast-math. (flag_fast_math_set_p): Test it. doc: * invoke.texi: Document -ffinite-math-only. f: * com.c (ffe_init_options): Set flag_finite_math_only. * invoke.texi: Document -fno-finite-math-only. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55887 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index e4aeca03875..9fe5cade312 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -575,6 +575,10 @@ int flag_errno_math = 1;
int flag_unsafe_math_optimizations = 0;
+/* Nonzero means that no NaNs or +-Infs are expected. */
+
+int flag_finite_math_only = 0;
+
/* Zero means that floating-point math operations cannot generate a
(user-visible) trap. This is the case, for example, in nonstop
IEEE 754 arithmetic. Trapping conditions include division by zero,
@@ -1170,6 +1174,8 @@ static const lang_independent_options f_options[] =
N_("Process #ident directives") },
{ "peephole2", &flag_peephole2, 1,
N_("Enables an rtl peephole pass run before sched2") },
+ {"finite-math-only", &flag_finite_math_only, 1,
+ N_("Assume no NaNs or +-Infs are generated") },
{ "guess-branch-probability", &flag_guess_branch_prob, 1,
N_("Enables guessing of branch probabilities") },
{"math-errno", &flag_errno_math, 1,
@@ -1575,6 +1581,7 @@ set_fast_math_flags (set)
{
flag_trapping_math = !set;
flag_unsafe_math_optimizations = set;
+ flag_finite_math_only = set;
flag_errno_math = !set;
if (set)
flag_signaling_nans = 0;
@@ -1586,6 +1593,7 @@ fast_math_flags_set_p ()
{
return (!flag_trapping_math
&& flag_unsafe_math_optimizations
+ && flag_finite_math_only
&& !flag_errno_math);
}