diff options
author | Richard Biener <rguenther@suse.de> | 2014-11-03 12:59:47 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-11-03 12:59:47 +0000 |
commit | f3582e541c61d1ae2f859d1c83ba6559fd5eccfb (patch) | |
tree | 887020564176f5e6ba895804546b1120a2686c82 /gcc/fold-const.c | |
parent | 9929321af792cefeb26ff1e59287f94fc0112b2c (diff) | |
download | gcc-f3582e541c61d1ae2f859d1c83ba6559fd5eccfb.zip gcc-f3582e541c61d1ae2f859d1c83ba6559fd5eccfb.tar.gz gcc-f3582e541c61d1ae2f859d1c83ba6559fd5eccfb.tar.bz2 |
match.pd: Add two abs patterns.
2014-11-03 Richard Biener <rguenther@suse.de>
* match.pd: Add two abs patterns. Announce tree_expr_nonnegative_p.
Also drop bogus FLOAT_EXPR and FIX_TRUNC_EXPR.
* fold-const.c (fold_unary_loc): Remove them here.
(tree_unary_nonnegative_warnv_p): Use CASE_CONVERT.
* gimple-fold.c (fold_gimple_assign): Remove now obsolete
GIMPLE_UNARY_RHS case.
(gimple_fold_stmt_to_constant_1): Likewise.
(replace_stmt_with_simplification): Fix inverted comparison.
From-SVN: r217039
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 78d5182..efcefa7 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -7958,8 +7958,6 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0) case ABS_EXPR: if (TREE_CODE (arg0) == INTEGER_CST || TREE_CODE (arg0) == REAL_CST) return fold_abs_const (arg0, type); - else if (TREE_CODE (arg0) == NEGATE_EXPR) - return fold_build1_loc (loc, ABS_EXPR, type, TREE_OPERAND (arg0, 0)); /* Convert fabs((double)float) into (double)fabsf(float). */ else if (TREE_CODE (arg0) == NOP_EXPR && TREE_CODE (type) == REAL_TYPE) @@ -7974,8 +7972,6 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0) /* ABS_EXPR<ABS_EXPR<x>> = ABS_EXPR<x> even if flag_wrapv is on. */ else if (TREE_CODE (arg0) == ABS_EXPR) return arg0; - else if (tree_expr_nonnegative_p (arg0)) - return arg0; /* Strip sign ops from argument. */ if (TREE_CODE (type) == REAL_TYPE) |