aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@redhat.com>2005-04-11 15:05:50 +0000
committerDiego Novillo <dnovillo@gcc.gnu.org>2005-04-11 11:05:50 -0400
commit9fabf0d4627f91b28d61b153e84053be525365ef (patch)
tree3ef2ff01848d34cb99c543d718a73a3aaf91f9ec /gcc/tree-vrp.c
parentf5db779b2b87248590386d588a1f8c662169d081 (diff)
downloadgcc-9fabf0d4627f91b28d61b153e84053be525365ef.zip
gcc-9fabf0d4627f91b28d61b153e84053be525365ef.tar.gz
gcc-9fabf0d4627f91b28d61b153e84053be525365ef.tar.bz2
re PR tree-optimization/20920 (ICE with eh and VRP)
PR tree-optimization/20920 * tree-pretty-print.c (dump_generic_node): Show '(ab)' if an SSA_NAME flows through an abnormal edge. * tree-vrp.c (infer_value_range): Ignore SSA names that flow through abnormal edges. (maybe_add_assert_expr): Likewise. PR tree-optimization/20920 * g++.dg/tree-ssa/pr20920.C: New test. From-SVN: r97971
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 3a3260a..3e366d2 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -1280,6 +1280,11 @@ fp_predicate (tree expr)
static tree
infer_value_range (tree stmt, tree op)
{
+ /* Do not attempt to infer anything in names that flow through
+ abnormal edges. */
+ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (op))
+ return NULL_TREE;
+
if (POINTER_TYPE_P (TREE_TYPE (op)))
{
bool is_store;
@@ -1385,7 +1390,7 @@ has_assert_expr (tree op, tree cond)
d) Mark X and Y in FOUND.
- 3- If BB does not end in a conditional expression, then we recurse
+ 4- If BB does not end in a conditional expression, then we recurse
into BB's dominator children.
At the end of the recursive traversal, ASSERT_EXPRs will have been
@@ -1441,7 +1446,7 @@ maybe_add_assert_expr (basic_block bb)
if (!cond)
continue;
- /* Step 3. If OP is used in such a way that we can infer a
+ /* Step 2. If OP is used in such a way that we can infer a
value range for it, create a new ASSERT_EXPR for OP
(unless OP already has an ASSERT_EXPR). */
gcc_assert (!is_ctrl_stmt (stmt));
@@ -1504,6 +1509,12 @@ maybe_add_assert_expr (basic_block bb)
sub-graphs or if they had been found in a block upstream from
BB. */
op = USE_OP (uses, 0);
+
+ /* Do not attempt to infer anything in names that flow through
+ abnormal edges. */
+ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (op))
+ return false;
+
RESET_BIT (found, SSA_NAME_VERSION (op));
/* Look for uses of the operands in each of the sub-graphs
@@ -1546,7 +1557,7 @@ maybe_add_assert_expr (basic_block bb)
}
else
{
- /* Step 3. Recurse into the dominator children of BB. */
+ /* Step 4. Recurse into the dominator children of BB. */
basic_block son;
for (son = first_dom_son (CDI_DOMINATORS, bb);