summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-23 15:57:09 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-23 15:57:09 +0000
commit7b56081a687b3949086fe37b26a825c7567630bf (patch)
treee71fcaef7ab6dc1b0e93c1f57a474e7fe80156e3 /gcc/fold-const.c
parent48976c0798a3541bd92888e554e41ae1654c4453 (diff)
downloadgcc-7b56081a687b3949086fe37b26a825c7567630bf.tar.gz
* fold-const.c (invert_tree_comparison): Always invert EQ_EXPR/NE_EXPR.
PR tree-optimization/44683 * tree-ssa-dom.c (record_edge_info): Record simple equivalences only if we can be sure that there are no signed zeros involved. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180340 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index a838c345881..e4c258903f7 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2100,15 +2100,14 @@ pedantic_non_lvalue_loc (location_t loc, tree x)
return protected_set_expr_location_unshare (x, loc);
}
-/* Given a tree comparison code, return the code that is the logical inverse
- of the given code. It is not safe to do this for floating-point
- comparisons, except for NE_EXPR and EQ_EXPR, so we receive a machine mode
- as well: if reversing the comparison is unsafe, return ERROR_MARK. */
+/* 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. */
enum tree_code
invert_tree_comparison (enum tree_code code, bool honor_nans)
{
- if (honor_nans && flag_trapping_math)
+ if (honor_nans && flag_trapping_math && code != EQ_EXPR && code != NE_EXPR)
return ERROR_MARK;
switch (code)