[lto] fix call to init_ssa_operands

Nathan Froyd froydnj@codesourcery.com
Tue Oct 23 17:37:00 GMT 2007


Apparently it does matter a great deal where the call to
init_ssa_operands is placed.  In our case, it needs to be placed *after*
we have built the function in SSA form.

Committed to the lto branch.

-Nathan

2007-10-23  Nathan Froyd  <froydnj@codesourcery.com>

	* lto-read.c (lto_read_body): Move call to init_ssa_operands...
	* lto.c (lto_materialize_function): ...to here.

Index: lto.c
===================================================================
--- lto.c	(revision 129563)
+++ lto.c	(working copy)
@@ -2426,7 +2426,12 @@ lto_materialize_function (lto_info_fd *f
                             /*top_level=*/1,
                             /*at_end=*/0);
   if (body)
-    cgraph_finalize_function (decl, /*nested=*/false);
+    {
+      /* cgraph expects this to be called once for each function.  */
+      init_ssa_operands ();
+
+      cgraph_finalize_function (decl, /*nested=*/false);
+    }
 }
 
 static tree
Index: lto-read.c
===================================================================
--- lto-read.c	(revision 129563)
+++ lto-read.c	(working copy)
@@ -1623,9 +1623,6 @@ lto_read_body (lto_info_fd *fd,
       cfun = fn;
       data_in.num_named_labels = header->num_named_labels;
 
-      /* cgraph expects this to be called once for each function.  */
-      init_ssa_operands ();
-
 #ifdef LTO_STREAM_DEBUGGING
       lto_debug_context.current_data = &debug_label;
 #endif



More information about the Gcc-patches mailing list