We run into
/* With return slot optimization we can end up with non-gimple (foo *)&this->m, fix that here. */ if (TREE_CODE (new_arg) != SSA_NAME && TREE_CODE (new_arg) != FUNCTION_DECL && !is_gimple_val (new_arg)) { gimple_seq stmts = NULL; new_arg = force_gimple_operand (new_arg, &stmts, true, NULL); gsi_insert_seq_on_edge_immediate (new_edge, stmts);
but inserting on an edge that needs splitting, which wrecks new_edge.
Index: tree-inline.c =================================================================== --- tree-inline.c (revision 164388) +++ tree-inline.c (working copy) @@ -2021,8 +2021,11 @@ copy_phis_for_bb (basic_block bb, copy_b && !is_gimple_val (new_arg)) { gimple_seq stmts = NULL; + basic_block tem; new_arg = force_gimple_operand (new_arg, &stmts, true, NULL); - gsi_insert_seq_on_edge_immediate (new_edge, stmts); + tem = gsi_insert_seq_on_edge_immediate (new_edge, stmts); + if (tem) + new_edge = find_edge (tem, new_bb); } add_phi_arg (new_phi, new_arg, new_edge, gimple_phi_arg_location_from_edge (phi, old_edge));
fixes that.
We run into
/* With return slot optimization we can end up with
non- gimple (foo *)&this->m, fix that here. */
&& TREE_CODE (new_arg) != FUNCTION_DECL
&& !is_gimple_val (new_arg))
gimple_ seq stmts = NULL;
new_ arg = force_gimple_ operand (new_arg, &stmts, true, NULL);
gsi_ insert_ seq_on_ edge_immediate (new_edge, stmts);
if (TREE_CODE (new_arg) != SSA_NAME
{
but inserting on an edge that needs splitting, which wrecks new_edge.
Index: tree-inline.c ======= ======= ======= ======= ======= ======= ======= ======= ==== operand (new_arg, &stmts, true, NULL); seq_on_ edge_immediate (new_edge, stmts); seq_on_ edge_immediate (new_edge, stmts);
gimple_ phi_arg_ location_ from_edge (phi, old_edge));
=======
--- tree-inline.c (revision 164388)
+++ tree-inline.c (working copy)
@@ -2021,8 +2021,11 @@ copy_phis_for_bb (basic_block bb, copy_b
&& !is_gimple_val (new_arg))
{
gimple_seq stmts = NULL;
+ basic_block tem;
new_arg = force_gimple_
- gsi_insert_
+ tem = gsi_insert_
+ if (tem)
+ new_edge = find_edge (tem, new_bb);
}
add_phi_arg (new_phi, new_arg, new_edge,
fixes that.