aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-fold.c
diff options
context:
space:
mode:
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:
{