ipa-inline-transform.c (inline_transform): Be ready for basic block to be changed...
authorJan Hubicka <jh@suse.cz>
Mon, 26 Aug 2013 15:23:48 +0000 (17:23 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 26 Aug 2013 15:23:48 +0000 (15:23 +0000)
* ipa-inline-transform.c (inline_transform): Be ready for basic block
to be changed by edge redirection.

From-SVN: r201997

gcc/ChangeLog
gcc/ipa-inline-transform.c

index d004d5496a8ec1b8f9922835158d3ce746a84e24..41d2b4167ed7d1ba7b2c7f18a092ae037b59f62e 100644 (file)
@@ -1,3 +1,8 @@
+2013-08-26  Jan Hubicka  <jh@suse.cz>
+
+       * ipa-inline-transform.c (inline_transform): Be ready for basic block
+       to be changed by edge redirection.
+
 2013-08-26  Jan Hubicka  <jh@suse.cz>
 
        * cgraph.c (cgraph_speculative_call_info): Fix parameter order and formating;
index 8ead336de64ef8b5ef7f10ff6baec82c877e9f8c..7f835eaf8360274d2833be89990849c5f142d775 100644 (file)
@@ -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 *node)
   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);