AFDO invokes cgraph_node_for_asm during VPT to get the cgraph node for
a callee. Use the resolved node so we don't add a reference to the
un-resolved node after LIPO fixup.

Passes regression tests and internal test. Ok for google/4_9?

Thanks,
Teresa

2014-07-23  Teresa Johnson  <tejohn...@google.com>

        Google ref b/16190119
        * cgraph.c (cgraph_node_for_asm): Return resolved node.

Index: cgraph.c
===================================================================
--- cgraph.c    (revision 212916)
+++ cgraph.c    (working copy)
@@ -677,7 +677,11 @@ cgraph_node_for_asm (tree asmname)
     {
       cgraph_node *cn = dyn_cast <cgraph_node> (node);
       if (cn && !cn->global.inlined_to)
-       return cn;
+        {
+          if (L_IPO_COMP_MODE && cgraph_pre_profiling_inlining_done)
+            return cgraph_lipo_get_resolved_node (cn->decl);
+          return cn;
+        }
     }
   return NULL;
 }


-- 
Teresa Johnson | Software Engineer | tejohn...@google.com | 408-460-2413

Reply via email to