This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/45709] [4.3/4.4/4.5/4.6 regression] internal compiler error: in add_phi_arg, at tree-phinodes.c:395



------- Comment #8 from rguenth at gcc dot gnu dot org  2010-09-18 09:53 -------
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.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45709


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]