diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2005-04-13 15:33:17 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2005-04-13 15:33:17 +0000 |
commit | 60b4ccde85cd8823678f3f424508fe19f9d302e4 (patch) | |
tree | bbc563f0437c0a8340dd241f0a15f7d13ce82259 /gcc/tree-vrp.c | |
parent | 9fb6cbd90e1a14cdacfa10af31317ddcd70af21f (diff) | |
download | gcc-60b4ccde85cd8823678f3f424508fe19f9d302e4.zip gcc-60b4ccde85cd8823678f3f424508fe19f9d302e4.tar.gz gcc-60b4ccde85cd8823678f3f424508fe19f9d302e4.tar.bz2 |
re PR tree-optimization/20913 (copy-prop does not fold conditionals)
gcc/
PR tree-optimization/20913
* tree-ssa-copy.c (copy_prop_visit_cond_stmt): Fold COND_EXPR.
testsuite/
PR tree-optimization/20913
* gcc.dg/tree-ssa/pr20913.c: New.
From-SVN: r98091
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index fa66ab9..e8f52bb 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -1500,6 +1500,7 @@ maybe_add_assert_expr (basic_block bb) edge e; edge_iterator ei; tree op, cond; + basic_block son; cond = COND_EXPR_COND (last); @@ -1554,6 +1555,17 @@ maybe_add_assert_expr (basic_block bb) /* Finally, mark all the COND_EXPR operands as found. */ SET_BIT (found, SSA_NAME_VERSION (op)); + + /* Recurse into the dominator children of BB that are not BB's + immediate successors. Note that we have already visited BB's + other dominator children above. */ + for (son = first_dom_son (CDI_DOMINATORS, bb); + son; + son = next_dom_son (CDI_DOMINATORS, son)) + { + if (find_edge (bb, son) == NULL) + added |= maybe_add_assert_expr (son); + } } else { |