aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2012-08-02 21:54:43 +0200
committerMarc Glisse <glisse@gcc.gnu.org>2012-08-02 19:54:43 +0000
commit77b5132f66c51aa41245f9b9f110141bd1629df5 (patch)
tree9870c86ac51cc17871ae568aecaada69d0859f38 /gcc/fold-const.c
parentc2381fb2f0715cf5f0f313bc0766d73c2f7b99e7 (diff)
downloadgcc-77b5132f66c51aa41245f9b9f110141bd1629df5.zip
gcc-77b5132f66c51aa41245f9b9f110141bd1629df5.tar.gz
gcc-77b5132f66c51aa41245f9b9f110141bd1629df5.tar.bz2
re PR tree-optimization/53805 (combine_comparisons changes trapping behavior)
2012-08-02 Marc Glisse <marc.glisse@inria.fr> PR tree-optimization/53805 * gcc/fold-const.c (invert_tree_comparison): Invert ORDERED_EXPR and UNORDERED_EXPR even for trapping floating point. * gcc/testsuite/gcc.dg/fold-notunord.c: New testcase. From-SVN: r190100
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index c136960..dfc01cc 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2094,12 +2094,14 @@ pedantic_non_lvalue_loc (location_t loc, tree x)
/* Given a tree comparison code, return the code that is the logical inverse.
It is generally not safe to do this for floating-point comparisons, except
- for EQ_EXPR and NE_EXPR, so we return ERROR_MARK in this case. */
+ for EQ_EXPR, NE_EXPR, ORDERED_EXPR and UNORDERED_EXPR, so we return
+ ERROR_MARK in this case. */
enum tree_code
invert_tree_comparison (enum tree_code code, bool honor_nans)
{
- if (honor_nans && flag_trapping_math && code != EQ_EXPR && code != NE_EXPR)
+ if (honor_nans && flag_trapping_math && code != EQ_EXPR && code != NE_EXPR
+ && code != ORDERED_EXPR && code != UNORDERED_EXPR)
return ERROR_MARK;
switch (code)