+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
else if (code == SAVE_EXPR)
return error_mark_node;
+ else if (code == STATEMENT_LIST)
+ gcc_unreachable ();
+
return copy_tree_r (tp, walk_subtrees, data);
}
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);
}
}
*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)