summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorglisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-02 19:54:43 +0000
committerglisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-02 19:54:43 +0000
commit17dbcd7c27d3d9ecc751b210643e0334877c9cd9 (patch)
tree9870c86ac51cc17871ae568aecaada69d0859f38 /gcc/fold-const.c
parent8a431c339648bedebb6497bdd81df99d4c6dcf27 (diff)
downloadgcc-17dbcd7c27d3d9ecc751b210643e0334877c9cd9.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190100 138bc75d-0d04-0410-961f-82ee72b054a4
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 c1369601fff..dfc01cc39a5 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)