Commit 597ae074 by Jan Hubicka Committed by Jan Hubicka

re PR middle-end/28071 (A file that can not be compiled in reasonable time/space)

	PR rtl-optimization/28071
	* tree-cfg.c (tree_split_block): Do not allocate new stmt_list nodes.
	* tree-iterator.c (tsi_split_statement_list_before): Do not crash when
	splitting before first stmt.

From-SVN: r115713
parent f10d1a74
2006-07-24 Jan Hubicka <jh@suse.cz> 2006-07-24 Jan Hubicka <jh@suse.cz>
PR rtl-optimization/28071 PR rtl-optimization/28071
* tree-cfg.c (tree_split_block): Do not allocate new stmt_list nodes.
* tree-iterator.c (tsi_split_statement_list_before): Do not crash when
splitting before first stmt.
2006-07-24 Jan Hubicka <jh@suse.cz>
PR rtl-optimization/28071
* ipa-inline.c (update_caller_keys): Remove edges that * ipa-inline.c (update_caller_keys): Remove edges that
are no longer inline candidates. are no longer inline candidates.
......
...@@ -4158,7 +4158,8 @@ tree_redirect_edge_and_branch_force (edge e, basic_block dest) ...@@ -4158,7 +4158,8 @@ tree_redirect_edge_and_branch_force (edge e, basic_block dest)
static basic_block static basic_block
tree_split_block (basic_block bb, void *stmt) tree_split_block (basic_block bb, void *stmt)
{ {
block_stmt_iterator bsi, bsi_tgt; block_stmt_iterator bsi;
tree_stmt_iterator tsi_tgt;
tree act; tree act;
basic_block new_bb; basic_block new_bb;
edge e; edge e;
...@@ -4192,13 +4193,17 @@ tree_split_block (basic_block bb, void *stmt) ...@@ -4192,13 +4193,17 @@ tree_split_block (basic_block bb, void *stmt)
} }
} }
bsi_tgt = bsi_start (new_bb); if (bsi_end_p (bsi))
while (!bsi_end_p (bsi)) return new_bb;
{
act = bsi_stmt (bsi); /* Split the statement list - avoid re-creating new containers as this
bsi_remove (&bsi, false); brings ugly quadratic memory consumption in the inliner.
bsi_insert_after (&bsi_tgt, act, BSI_NEW_STMT); (We are still quadratic since we need to update stmt BB pointers,
} sadly.) */
new_bb->stmt_list = tsi_split_statement_list_before (&bsi.tsi);
for (tsi_tgt = tsi_start (new_bb->stmt_list);
!tsi_end_p (tsi_tgt); tsi_next (&tsi_tgt))
set_bb_for_stmt (tsi_stmt (tsi_tgt), new_bb);
return new_bb; return new_bb;
} }
......
...@@ -289,6 +289,7 @@ tsi_split_statement_list_before (tree_stmt_iterator *i) ...@@ -289,6 +289,7 @@ tsi_split_statement_list_before (tree_stmt_iterator *i)
STATEMENT_LIST_TAIL (new_sl) = STATEMENT_LIST_TAIL (old_sl); STATEMENT_LIST_TAIL (new_sl) = STATEMENT_LIST_TAIL (old_sl);
STATEMENT_LIST_TAIL (old_sl) = prev; STATEMENT_LIST_TAIL (old_sl) = prev;
cur->prev = NULL; cur->prev = NULL;
if (prev)
prev->next = NULL; prev->next = NULL;
return new_sl; return new_sl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment