summaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-11 14:14:04 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-11 14:14:04 +0000
commitffeeba75e6b0ff4d7fd8024a7a2df4eb7052bf08 (patch)
tree8d81f7c50475db8eb044f51fad1b4c6dcec08003 /gcc/tree-vrp.c
parentea201ad86fae4f24908ad63805721ded45c1f7ab (diff)
downloadgcc-ffeeba75e6b0ff4d7fd8024a7a2df4eb7052bf08.tar.gz
2008-04-11 Richard Guenther <rguenther@suse.de>
PR tree-optimization/35869 * tree-vrp.c (execute_vrp): Move switch statement update after jump threading. Schedule another cfg cleanup run. * gcc.c-torture/compile/pr35869.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134197 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 7ea026272b8..76477c850ac 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -6734,20 +6734,6 @@ execute_vrp (void)
ssa_propagate (vrp_visit_stmt, vrp_visit_phi_node);
vrp_finalize ();
- /* Remove dead edges from SWITCH_EXPR optimization. This leaves the
- CFG in a broken state and requires a cfg_cleanup run. */
- for (i = 0; VEC_iterate (edge, to_remove_edges, i, e); ++i)
- remove_edge (e);
- /* Update SWITCH_EXPR case label vector. */
- for (i = 0; VEC_iterate (switch_update, to_update_switch_stmts, i, su); ++i)
- SWITCH_LABELS (su->stmt) = su->vec;
-
- if (VEC_length (edge, to_remove_edges) > 0)
- free_dominance_info (CDI_DOMINATORS);
-
- VEC_free (edge, heap, to_remove_edges);
- VEC_free (switch_update, heap, to_update_switch_stmts);
-
/* ASSERT_EXPRs must be removed before finalizing jump threads
as finalizing jump threads calls the CFG cleanup code which
does not properly handle ASSERT_EXPRs. */
@@ -6761,6 +6747,24 @@ execute_vrp (void)
update_ssa (TODO_update_ssa);
finalize_jump_threads ();
+
+ /* Remove dead edges from SWITCH_EXPR optimization. This leaves the
+ CFG in a broken state and requires a cfg_cleanup run. */
+ for (i = 0; VEC_iterate (edge, to_remove_edges, i, e); ++i)
+ remove_edge (e);
+ /* Update SWITCH_EXPR case label vector. */
+ for (i = 0; VEC_iterate (switch_update, to_update_switch_stmts, i, su); ++i)
+ SWITCH_LABELS (su->stmt) = su->vec;
+
+ if (VEC_length (edge, to_remove_edges) > 0)
+ {
+ free_dominance_info (CDI_DOMINATORS);
+ cleanup_tree_cfg ();
+ }
+
+ VEC_free (edge, heap, to_remove_edges);
+ VEC_free (switch_update, heap, to_update_switch_stmts);
+
scev_finalize ();
loop_optimizer_finalize ();