Hi, the problem in PR 57084 is that late PRE devirtualization creates a direct call to a decl fro which we only have an inlined call graph mode in the given partition. I tried to find a most universal place where to fix it because this problem is not special to type-based devirtualization and in theory can be caused by any call to a decl that is grabbed from a constructor. I think the best place is the following one-liner, because all such decls should go through canonicalize_constructor_val.
Bootstrapped and tested on x86_64-linux, fixes the testcase (at -m32) and I have happened to also LTO build Mozilla Firefox with it. OK for trunk? Thanks, Martin 2013-05-06 Martin Jambor <mjam...@suse.cz> PR lto/57084 * gimple-fold.c (canonicalize_constructor_val): Call cgraph_get_create_real_symbol_node instead of cgraph_get_create_node. Index: src/gcc/gimple-fold.c =================================================================== --- src.orig/gcc/gimple-fold.c +++ src/gcc/gimple-fold.c @@ -178,7 +178,7 @@ canonicalize_constructor_val (tree cval, /* Make sure we create a cgraph node for functions we'll reference. They can be non-existent if the reference comes from an entry of an external vtable for example. */ - cgraph_get_create_node (base); + cgraph_get_create_real_symbol_node (base); } /* Fixup types in global initializers. */ if (TREE_TYPE (TREE_TYPE (cval)) != TREE_TYPE (TREE_OPERAND (cval, 0)))