diff options
author | Jan Hubicka <jh@suse.cz> | 2010-09-19 01:13:17 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2010-09-18 23:13:17 +0000 |
commit | 9b389a5e64f957b30eb05315b7e15a649a8e1f66 (patch) | |
tree | 863c05e9f2399d3ae354b494076e8a668b4ee323 /gcc/cgraphunit.c | |
parent | 1151446c17ede83ed30b2bfc68137e7573ed0d99 (diff) | |
download | gcc-9b389a5e64f957b30eb05315b7e15a649a8e1f66.zip gcc-9b389a5e64f957b30eb05315b7e15a649a8e1f66.tar.gz gcc-9b389a5e64f957b30eb05315b7e15a649a8e1f66.tar.bz2 |
re PR tree-optimization/45453 (ICE: verify_cgraph_node failed: inlined_to pointer set for noninline callers with -O2 -fno-early-inlining)
PR tree-optimization/45453
* cgraphunit.c (cgraph_finalize_function): Consider comdat & external
virtual functions are reachable.
* ipa-inline.c (cgraph_clone_inlined_nodes): Likewise.
* ipa.c (cgraph_remove_unreachable_nodes): Likewise.
* ipa-prop.c (ipa_modify_formal_parameters): Clear DECL_VIRTUAL_P
when modifying function.
* g++.dg/tree-ssa/pr45453.C: New testcase.
From-SVN: r164405
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r-- | gcc/cgraphunit.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index f296fe0..e390ec6 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -363,7 +363,13 @@ cgraph_finalize_function (tree decl, bool nested) there. */ if ((TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)) || DECL_STATIC_CONSTRUCTOR (decl) - || DECL_STATIC_DESTRUCTOR (decl)) + || DECL_STATIC_DESTRUCTOR (decl) + /* COMDAT virtual functions may be referenced by vtable from + other compilatoin unit. Still we want to devirtualize calls + to those so we need to analyze them. + FIXME: We should introduce may edges for this purpose and update + their handling in unreachable function removal and inliner too. */ + || (DECL_VIRTUAL_P (decl) && (DECL_COMDAT (decl) || DECL_EXTERNAL (decl)))) cgraph_mark_reachable_node (node); /* If we've not yet emitted decl, tell the debug info about it. */ |