aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-05-03 13:43:06 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-05-03 13:43:06 +0200
commite7437b594f9c54bc07a2ef0bda9801ce62b1eab7 (patch)
tree9171de8194afb338e1740a5022ab98933b0653ca /gcc/tree-if-conv.c
parentdea60b590ccf8968b5b651eddfc25ddf3226c8a1 (diff)
downloadgcc-e7437b594f9c54bc07a2ef0bda9801ce62b1eab7.zip
gcc-e7437b594f9c54bc07a2ef0bda9801ce62b1eab7.tar.gz
gcc-e7437b594f9c54bc07a2ef0bda9801ce62b1eab7.tar.bz2
re PR tree-optimization/70916 (gcc ICE at -O3 on valid code on x86_64-linux-gnu in "tree_operand_check")
PR tree-optimization/70916 * tree-if-conv.c (constant_or_ssa_name): Removed. (fold_build_cond_expr): Use is_gimple_val instead of constant_or_ssa_name. From-SVN: r235815
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r--gcc/tree-if-conv.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 97b62b7..72dca98 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -416,24 +416,6 @@ fold_or_predicates (location_t loc, tree c1, tree c2)
return fold_build2_loc (loc, TRUTH_OR_EXPR, boolean_type_node, c1, c2);
}
-/* Returns true if N is either a constant or a SSA_NAME. */
-
-static bool
-constant_or_ssa_name (tree n)
-{
- switch (TREE_CODE (n))
- {
- case SSA_NAME:
- case INTEGER_CST:
- case REAL_CST:
- case COMPLEX_CST:
- case VECTOR_CST:
- return true;
- default:
- return false;
- }
-}
-
/* Returns either a COND_EXPR or the folded expression if the folded
expression is a MIN_EXPR, a MAX_EXPR, an ABS_EXPR,
a constant or a SSA_NAME. */
@@ -454,22 +436,21 @@ fold_build_cond_expr (tree type, tree cond, tree rhs, tree lhs)
&& (integer_zerop (op1)))
cond = op0;
}
- cond_expr = fold_ternary (COND_EXPR, type, cond,
- rhs, lhs);
+ cond_expr = fold_ternary (COND_EXPR, type, cond, rhs, lhs);
if (cond_expr == NULL_TREE)
return build3 (COND_EXPR, type, cond, rhs, lhs);
STRIP_USELESS_TYPE_CONVERSION (cond_expr);
- if (constant_or_ssa_name (cond_expr))
+ if (is_gimple_val (cond_expr))
return cond_expr;
if (TREE_CODE (cond_expr) == ABS_EXPR)
{
rhs1 = TREE_OPERAND (cond_expr, 1);
STRIP_USELESS_TYPE_CONVERSION (rhs1);
- if (constant_or_ssa_name (rhs1))
+ if (is_gimple_val (rhs1))
return build1 (ABS_EXPR, type, rhs1);
}
@@ -480,8 +461,7 @@ fold_build_cond_expr (tree type, tree cond, tree rhs, tree lhs)
STRIP_USELESS_TYPE_CONVERSION (lhs1);
rhs1 = TREE_OPERAND (cond_expr, 1);
STRIP_USELESS_TYPE_CONVERSION (rhs1);
- if (constant_or_ssa_name (rhs1)
- && constant_or_ssa_name (lhs1))
+ if (is_gimple_val (rhs1) && is_gimple_val (lhs1))
return build2 (TREE_CODE (cond_expr), type, lhs1, rhs1);
}
return build3 (COND_EXPR, type, cond, rhs, lhs);