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]

PR bootstrap/40082

this patch fixed inlined_to pointer updating problem manifested by the
attached testcase in PR.  I hope it solves bootstrap problem too, but I
am waiting for confirmation.

Bootstrapped/regtested x86_64-linux, comitted.

	PR bootstrap/40082
	* ipa.c (update_inlined_to_pointer): New function.
	(cgraph_remove_unreachable_nodes): Use it.
Index: ipa.c
--- ipa.c	(revision 147318)
+++ ipa.c	(working copy)
@@ -92,6 +92,21 @@ cgraph_postorder (struct cgraph_node **o
   return order_pos;
+/* Look for all functions inlined to NODE and update their inlined_to pointers
+   to INLINED_TO.  */
+static void
+update_inlined_to_pointer (struct cgraph_node *node, struct cgraph_node *inlined_to)
+  struct cgraph_edge *e;
+  for (e = node->callees; e; e = e->next_callee)
+    if (e->callee->global.inlined_to)
+      {
+        e->callee->global.inlined_to = inlined_to;
+	update_inlined_to_pointer (e->callee, inlined_to);
+      }
 /* Perform reachability analysis and reclaim all unreachable nodes.
    If BEFORE_INLINING_P is true this function is called before inlining
    decisions has been made.  If BEFORE_INLINING_P is false this function also 
@@ -214,7 +229,8 @@ cgraph_remove_unreachable_nodes (bool be
 	  && !node->callers)
 	  gcc_assert (node->clones);
-	  node->global.inlined_to = false;
+	  node->global.inlined_to = NULL;
+	  update_inlined_to_pointer (node, node);
       node->aux = NULL;

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