From 17ed8337fd011840b44de9e824adfa1289ee3684 Mon Sep 17 00:00:00 2001 From: rguenth Date: Wed, 20 Aug 2008 08:28:17 +0000 Subject: 2008-08-20 Richard Guenther * tree-vrp.c (found_in_subgraph): Remove. (live): New global static. (live_on_edge): New function. (blocks_visited): Remove. (register_edge_assert_for_2): Use live_on_edge. (find_conditional_asserts): Remove code dealing with found_in_subgraph. Do not walk the CFG. (find_switch_asserts): Likewise. (find_assert_locations_1): Renamed from find_assert_locations. Move finding assert locations for conditional and switch statements first. Update live bitmap. Do not walk the CFG. (find_assert_locations): New function. (insert_range_assertions): Remove entry of CFG walk. Adjust call to find_assert_locations. * tree-ssa-pre.c (do_regular_insertion): Ignore critical edges that only can appear because of fake exit edges but assert we never try to insert on those. (fini_pre): Do not remove fake exit edges here... (execute_pre): ...but here, before committing edge inserts. * gcc.dg/tree-ssa/pr20701.c: Scan vrp1 dump. * gcc.dg/tree-ssa/ssa-dom-thread-1.c: Pass -fno-tree-vrp. * gcc.dg/tree-ssa/ssa-pre-20.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139263 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-ssa-pre.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'gcc/tree-ssa-pre.c') diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index cc5678258a1..d2a55ae7ddc 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -3160,14 +3160,9 @@ do_regular_insertion (basic_block block, basic_block dom) { unsigned int vprime; - /* This can happen in the very weird case - that our fake infinite loop edges have caused a - critical edge to appear. */ - if (EDGE_CRITICAL_P (pred)) - { - cant_insert = true; - break; - } + /* We should never run insertion for the exit block + and so not come across fake pred edges. */ + gcc_assert (!(pred->flags & EDGE_FAKE)); bprime = pred->src; eprime = phi_translate (expr, ANTIC_IN (block), NULL, bprime, block); @@ -3299,14 +3294,9 @@ do_partial_partial_insertion (basic_block block, basic_block dom) unsigned int vprime; pre_expr edoubleprime; - /* This can happen in the very weird case - that our fake infinite loop edges have caused a - critical edge to appear. */ - if (EDGE_CRITICAL_P (pred)) - { - cant_insert = true; - break; - } + /* We should never run insertion for the exit block + and so not come across fake pred edges. */ + gcc_assert (!(pred->flags & EDGE_FAKE)); bprime = pred->src; eprime = phi_translate (expr, ANTIC_IN (block), PA_IN (block), @@ -4117,7 +4107,6 @@ fini_pre (bool do_fre) free_alloc_pool (pre_expr_pool); htab_delete (phi_translate_table); htab_delete (expression_to_id); - remove_fake_exit_edges (); FOR_ALL_BB (bb) { @@ -4203,6 +4192,11 @@ execute_pre (bool do_fre ATTRIBUTE_UNUSED) statistics_counter_event (cfun, "New PHIs", pre_stats.phis); statistics_counter_event (cfun, "Eliminated", pre_stats.eliminations); statistics_counter_event (cfun, "Constified", pre_stats.constified); + + /* Make sure to remove fake edges before committing our inserts. + This makes sure we don't end up with extra critical edges that + we would need to split. */ + remove_fake_exit_edges (); gsi_commit_edge_inserts (); clear_expression_ids (); -- cgit v1.2.1