Hi,
when target of polymorphic call was first determined speculatively and later
determined exactly we compare targets for a match and if they match, we use
the original speculative edge.  This is becuase we may have already optimized
through this edge.  The test is done by comparing decls that brings unnecesary
failures when we use local aliases.  Fixed thus.

regtested/bootstrapped x86_64-linux, comitted.

Index: ChangeLog
===================================================================
--- ChangeLog   (revision 202887)
+++ ChangeLog   (working copy)
@@ -1,3 +1,8 @@
+2013-09-25  Jan Hubicka  <j...@suse.cz>
+
+       * cgraph.c (cgraph_resolve_speculation): Use semantical equivalency
+       test.
+
 2013-09-25  Marek Polacek  <pola...@redhat.com>
 
        PR sanitizer/58420
Index: cgraph.c
===================================================================
--- cgraph.c    (revision 202838)
+++ cgraph.c    (working copy)
@@ -1188,7 +1188,9 @@ cgraph_resolve_speculation (struct cgrap
 
   gcc_assert (edge->speculative);
   cgraph_speculative_call_info (edge, e2, edge, ref);
-  if (ref->referred->symbol.decl != callee_decl)
+  if (!callee_decl
+      || !symtab_semantically_equivalent_p ((symtab_node) ref->referred,
+                                           symtab_get_node (callee_decl)))
     {
       if (dump_file)
        {

Reply via email to