Commit deb5046b by Jason Merrill Committed by Jason Merrill

re PR c++/40975 (ICE in copy_tree_r on array new)

	PR c++/40975
	* tree-inline.c (copy_tree_r): Use copy_statement_list.
	(copy_statement_list): Don't recurse.
	* stor-layout.c (copy_self_referential_tree_r): Don't allow
	STATEMENT_LIST.

From-SVN: r173451
parent 31e292c7
2011-05-05 Jason Merrill <jason@redhat.com>
PR c++/40975
* tree-inline.c (copy_tree_r): Use copy_statement_list.
(copy_statement_list): Don't recurse.
* stor-layout.c (copy_self_referential_tree_r): Don't allow
STATEMENT_LIST.
2011-05-05 Joseph Myers <joseph@codesourcery.com>
* config/rs6000/rs6000.c (rs6000_handle_option): Don't fall
......
......@@ -177,6 +177,9 @@ copy_self_referential_tree_r (tree *tp, int *walk_subtrees, void *data)
else if (code == SAVE_EXPR)
return error_mark_node;
else if (code == STATEMENT_LIST)
gcc_unreachable ();
return copy_tree_r (tp, walk_subtrees, data);
}
......
......@@ -662,8 +662,6 @@ copy_statement_list (tree *tp)
for (; !tsi_end_p (oi); tsi_next (&oi))
{
tree stmt = tsi_stmt (oi);
if (TREE_CODE (stmt) == STATEMENT_LIST)
copy_statement_list (&stmt);
tsi_link_after (&ni, stmt, TSI_CONTINUE_LINKING);
}
}
......@@ -4271,19 +4269,9 @@ copy_tree_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
*tp = new_tree;
}
else if (code == STATEMENT_LIST)
{
/* We used to just abort on STATEMENT_LIST, but we can run into them
with statement-expressions (c++/40975). */
tree new_list = alloc_stmt_list ();
tree_stmt_iterator i = tsi_start (*tp);
tree_stmt_iterator j = tsi_last (new_list);
for (; !tsi_end_p (i); tsi_next (&i))
{
tree stmt = tsi_stmt (i);
tsi_link_after (&j, stmt, TSI_CONTINUE_LINKING);
}
*tp = new_list;
}
/* We used to just abort on STATEMENT_LIST, but we can run into them
with statement-expressions (c++/40975). */
copy_statement_list (tp);
else if (TREE_CODE_CLASS (code) == tcc_type)
*walk_subtrees = 0;
else if (TREE_CODE_CLASS (code) == tcc_declaration)
......
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