Hi,

after a clone is materialized, its clone_of field is cleared which in
PR 61211 leads to a failure in the skipped_thunk path in clone_of_p in
cgraph.c, which then leads to a false positive verification failure.

Fixed by the following patch.  Bootstrapped and tested on x86_64-linux
on both the trunk and the 4.9 branch.  OK for both?

Thanks,

Martin


2014-05-30  Martin Jambor  <mjam...@suse.cz>

        PR ipa/61211
        * cgraph.c (clone_of_p): Allow skipped_branch to deal with
        expanded clones.

diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index ff65b86..f18f977 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -2566,11 +2566,16 @@ clone_of_p (struct cgraph_node *node, struct 
cgraph_node *node2)
       skipped_thunk = true;
     }
 
-  if (skipped_thunk
-      && (!node2->clone_of
-         || !node2->clone.args_to_skip
-         || !bitmap_bit_p (node2->clone.args_to_skip, 0)))
-    return false;
+  if (skipped_thunk)
+    {
+      if (!node2->clone.args_to_skip
+         || !bitmap_bit_p (node2->clone.args_to_skip, 0))
+       return false;
+      if (node2->former_clone_of == node->decl)
+       return true;
+      else if (!node2->clone_of)
+       return false;
+    }
 
   while (node != node2 && node2)
     node2 = node2->clone_of;

Reply via email to