http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58585
Bug ID: 58585 Summary: [4.9 Regression] ICE in ipa with virtual inheritance Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org The following valid code snippet triggers an ICE on trunk when compiled with "-O2 -fPIC": ================================ struct A { virtual void foo() {} void bar(); }; void A::bar() { foo(); } struct B : virtual A { virtual void foo() {} char c; }; struct C : virtual B { C(); }; C::C() { bar(); } ================================ bug.cc:18:17: internal compiler error: in ipa_get_indirect_edge_target_1, at ipa-cp.c:1570 C::C() { bar(); } ^ 0xf46f8d ipa_get_indirect_edge_target_1 ../../gcc/gcc/ipa-cp.c:1569 0x9958fe estimate_edge_devirt_benefit ../../gcc/gcc/ipa-inline-analysis.c:2783 0x9958fe estimate_edge_size_and_time ../../gcc/gcc/ipa-inline-analysis.c:2815 0x9958fe estimate_calls_size_and_time ../../gcc/gcc/ipa-inline-analysis.c:2868 0x996a72 estimate_node_size_and_time ../../gcc/gcc/ipa-inline-analysis.c:2955 0x999046 do_estimate_edge_size(cgraph_edge*) ../../gcc/gcc/ipa-inline-analysis.c:3498 0x99918c estimate_edge_size ../../gcc/gcc/ipa-inline.h:275 0x99918c estimate_edge_growth ../../gcc/gcc/ipa-inline.h:287 0x99918c do_estimate_growth_1 ../../gcc/gcc/ipa-inline-analysis.c:3609 0x8004de cgraph_for_node_and_aliases(cgraph_node*, bool (*)(cgraph_node*, void*), void*, bool) ../../gcc/gcc/cgraph.c:2156 0x999617 do_estimate_growth(cgraph_node*) ../../gcc/gcc/ipa-inline-analysis.c:3623 0xf5513d estimate_growth ../../gcc/gcc/ipa-inline.h:262 0xf5513d inline_small_functions ../../gcc/gcc/ipa-inline.c:1549 0xf5513d ipa_inline ../../gcc/gcc/ipa-inline.c:2009 0xf5513d execute ../../gcc/gcc/ipa-inline.c:2379 Please submit a full bug report, [etc.] The regression appeared between 4.9.0-20130922 and 4.9.0-20130926.