diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2011-10-23 15:57:09 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-10-23 15:57:09 +0000 |
commit | 4db183a2d5c98d60144b88dcf402f06fc2103200 (patch) | |
tree | e71fcaef7ab6dc1b0e93c1f57a474e7fe80156e3 /gcc/fold-const.c | |
parent | d621a5fb6d9bd91e30e96ba9ee60ac8ec1350ee1 (diff) | |
download | gcc-4db183a2d5c98d60144b88dcf402f06fc2103200.zip gcc-4db183a2d5c98d60144b88dcf402f06fc2103200.tar.gz gcc-4db183a2d5c98d60144b88dcf402f06fc2103200.tar.bz2 |
re PR tree-optimization/44683 (Optimization bug with copysign builtin)
* 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.
From-SVN: r180340
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index a838c34..e4c2589 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) |