This is the mail archive of the 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]

Fix edge redirection in ipa-inline-transform

this patch fixes bug that triggers an ICE when building firefox;
cgraph_redirect_edge_call_stmt_to_callee can now remove an edge it is
given and thus inline_transform must keep track of next pointer.

Bootstrapped/regtested ppc64-linux, commited.

Index: ChangeLog
--- ChangeLog	(revision 201996)
+++ ChangeLog	(working copy)
@@ -1,5 +1,10 @@
 2013-08-26  Jan Hubicka  <>
+	* ipa-inline-transform.c (inline_transform): Be ready for edge
+	to be changed by edge redirection.
+2013-08-26  Jan Hubicka  <>
 	* cgraph.c (cgraph_speculative_call_info): Fix parameter order and formating;
 	add sanity check.
 	(cgraph_resolve_speculation): Add FIXME about scaling profiles.
Index: ipa-inline-transform.c
--- ipa-inline-transform.c	(revision 201995)
+++ ipa-inline-transform.c	(working copy)
@@ -412,7 +412,7 @@ unsigned int
 inline_transform (struct cgraph_node *node)
   unsigned int todo = 0;
-  struct cgraph_edge *e;
+  struct cgraph_edge *e, *next;
   /* FIXME: Currently the pass manager is adding inline transform more than
      once to some clones.  This needs revisiting after WPA cleanups.  */
@@ -424,8 +424,11 @@ inline_transform (struct cgraph_node *no
   if (preserve_function_body_p (node))
     save_inline_function_body (node);
-  for (e = node->callees; e; e = e->next_callee)
-    cgraph_redirect_edge_call_stmt_to_callee (e);
+  for (e = node->callees; e; e = next)
+    {
+      next = e->next_callee;
+      cgraph_redirect_edge_call_stmt_to_callee (e);
+    }
   ipa_remove_all_references (&node->symbol.ref_list);
   timevar_push (TV_INTEGRATION);

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