This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Improve PR28796 (inconsistend __builtin_nan() and __builtin_unordered()) further

On Thu, 24 Aug 2006, Roger Sayle wrote:

> On Thu, 24 Aug 2006, Richard Guenther wrote:
> > 2006-08-25  Richard Guenther  <>
> >
> > 	PR middle-end/28796
> > 	* simplify-rtx.c (simplify_const_relational_operation):
> > 	Do not constant-fold ORDERED and UNORDERED for
> > 	flag_unsafe_math_optimizations but only we do not need to
> > 	honor NaNs for the given mode.
> This is OK for 4.3.  If you can find an old version of GCC, that
> didn't attempt to optimize C99's isunordered as a builtin, then this
> patch is also OK for mainline.

Archeology reveals that at some time we had only flag_fast_math which

+2001-03-07  Brad Lucier  <>
+       * builtins.c (expand_builtin_mathfn): Check
+       flag_unsafe_math_optimizations, not flag_fast_math.
+       (expand_builtin): Likewise
+       * combine.c (combine_simplify_rtx): Likewise.
+       (simplify_if_then_else): Likewise.
+       * cse.c (fold_rtx): Likewise.
+       * flags.h: Remove flag_fast_math.  Add 
+       flag_unsafe_math_optimizations and flag_trapping_math.
+       * simplify-rtx.c (simplify_binary_operation): Likewise.
+       (simplify_relational_operation): Likewise.
+       (simplify_ternary_operation): Likewise.
+       * config/i386/i386.c (override_options): Likewise

split into flag_unsafe_math_optimizations and flag_trapping_math.  Later
Toon introduced flag_finite_math_only

2002-07-30  Toon Moene  <>

        * flags.h: Declare flag_finite_math_only.
        Use it in definition of HONOR_NANS and
        * 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.

but at that point we didn't convert all of the remaining "-ffast-math"
(which just became flag_unsafe_math_optimizations check) to either
flag_finite_math_only or flag_unsafe_math_optimizations.

So I don't think we can say that all these bugs are regressions.  They
are technically still wrong-code, so maybe applicable for fixing in
mainline and branches once they are open for bugfixes again.


Richard Guenther <>
Novell / SUSE Labs

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]