aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-fold.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-11-03 12:59:47 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-11-03 12:59:47 +0000
commitf3582e541c61d1ae2f859d1c83ba6559fd5eccfb (patch)
tree887020564176f5e6ba895804546b1120a2686c82 /gcc/gimple-fold.c
parent9929321af792cefeb26ff1e59287f94fc0112b2c (diff)
downloadgcc-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/gimple-fold.c')
-rw-r--r--gcc/gimple-fold.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index 088a0dd..547f9a7 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -417,27 +417,6 @@ fold_gimple_assign (gimple_stmt_iterator *si)
break;
case GIMPLE_UNARY_RHS:
- {
- tree rhs = gimple_assign_rhs1 (stmt);
-
- result = fold_unary_loc (loc, subcode, gimple_expr_type (stmt), rhs);
- if (result)
- {
- /* If the operation was a conversion do _not_ mark a
- resulting constant with TREE_OVERFLOW if the original
- constant was not. These conversions have implementation
- defined behavior and retaining the TREE_OVERFLOW flag
- here would confuse later passes such as VRP. */
- if (CONVERT_EXPR_CODE_P (subcode)
- && TREE_CODE (result) == INTEGER_CST
- && TREE_CODE (rhs) == INTEGER_CST)
- TREE_OVERFLOW (result) = TREE_OVERFLOW (rhs);
-
- STRIP_USELESS_TYPE_CONVERSION (result);
- if (valid_gimple_rhs_p (result))
- return result;
- }
- }
break;
case GIMPLE_BINARY_RHS:
@@ -2876,7 +2855,7 @@ replace_stmt_with_simplification (gimple_stmt_iterator *gsi,
&& rcode.is_tree_code ())
{
if (!inplace
- || gimple_num_ops (stmt) <= get_gimple_rhs_num_ops (rcode))
+ || gimple_num_ops (stmt) > get_gimple_rhs_num_ops (rcode))
{
maybe_build_generic_op (rcode,
TREE_TYPE (gimple_assign_lhs (stmt)),
@@ -4523,16 +4502,7 @@ gimple_fold_stmt_to_constant_1 (gimple stmt, tree (*valueize) (tree))
}
case GIMPLE_UNARY_RHS:
- {
- /* Handle unary operators that can appear in GIMPLE form.
- Note that we know the single operand must be a constant,
- so this should almost always return a simplified RHS. */
- tree op0 = (*valueize) (gimple_assign_rhs1 (stmt));
-
- return
- fold_unary_ignore_overflow_loc (loc, subcode,
- gimple_expr_type (stmt), op0);
- }
+ return NULL_TREE;
case GIMPLE_BINARY_RHS:
{