C++ testcase: namespace std { template<typename _Tp> struct allocator { }; } namespace __gnu_cxx { } namespace std { template<typename _CharT, typename _Traits, typename _Alloc> class basic_string { }; template<typename _Tp, typename _Alloc> struct _Vector_base { struct _Vector_impl : public _Tp_alloc_type { }; ~_Vector_base() { } }; template<typename _Tp, typename _Alloc = std::allocator<_Tp> > class vector : protected _Vector_base<_Tp, _Alloc> { }; struct surface_restorer { }; namespace events { struct handler { virtual ~handler(); }; struct widget : public events::handler { std::vector< surface_restorer > restorer_; }; struct scrollbar : public widget { }; scrollbar a;
The ICE is: t.cc:33: error: inlined_to pointer is set but no predecesors found virtual std::events::scrollbar::~scrollbar()/33: (inline copy in void __static_initialization_and_destruction_0(int, int)/11) availability:available(9) 35 insns (89 after inlining) tree externally_visible finalized inlinable called by: calls: std::events::widget::~widget()/4 (inlined) void operator delete(void*)/26 t.cc:33: internal compiler error: verify_cgraph_node failed Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. It seems wrong that we are running the inliner when we have errors.
Confirmed. Reduced testcase: ======================= struct A { ERROR; ~A(); }; struct B { virtual ~B(); }; struct C : B, A {}; struct D : C {}; D d; =======================
*** Bug 26281 has been marked as a duplicate of this bug. ***
*** Bug 26979 has been marked as a duplicate of this bug. ***
*** Bug 27207 has been marked as a duplicate of this bug. ***
This also can ICE with valid code with -Werror and a warning was emitted, PR 27207 was that case.
here is the fix I came up with: Index: cgraphunit.c =================================================================== --- cgraphunit.c (revision 113199) +++ cgraphunit.c (working copy) @@ -1404,7 +1404,8 @@ cgraph_optimize (void) fprintf (cgraph_dump_file, "Marked "); dump_cgraph (cgraph_dump_file); } - ipa_passes (); + if (errorcount == 0 && sorrycount == 0) + ipa_passes (); /* This pass remove bodies of extern inline functions we never inlined. Do this later so other IPA passes see what is really going on. */ cgraph_remove_unreachable_nodes (false, dump_file);
Created attachment 11334 [details] fix typo in errormessage in verify_cgraph_node() Just as a sidenote.. There is a typo in the error message in comment #1. The attached patch fixes this on the 4.1 branch and on trunk. Please apply, TIA. 2006-04-25 Bernhard Fischer <aldot@gcc.gnu.org> * cgraphunit.c (verify_cgraph_node): Fix typo s/predecesors/predecessors/ in error message.
Both patches (comment #7 and comment #8) are OK assuming they pass testing (that is rather obvious). Thanks, Honza
Mine.
(In reply to comment #10) > Mine. Did you resolve your copyright problems?
(In reply to comment #11) > Did you resolve your copyright problems? No but this patch is small enough not to need a copyright assignment so I am going to commit it now.
Fixed.
Subject: Bug 25776 Author: pinskia Date: Sat May 20 22:35:02 2006 New Revision: 113941 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113941 Log: 2006-05-20 Andrew Pinski <pinskia@physics.uc.edu> PR middle-end/25776 * cgraphunit.c (cgraph_optimize): Don't run ipa passes if error or sorry count is non zero. 2006-05-20 Andrew Pinski <pinskia@physics.uc.edu> PR middle-end/25776 * g++.dg/other/error11.C: New test. Added: trunk/gcc/testsuite/g++.dg/other/error11.C Modified: trunk/gcc/ChangeLog trunk/gcc/cgraphunit.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 25776 Author: aldot Date: Sun May 21 13:10:37 2006 New Revision: 113952 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113952 Log: ACKed by Jan Hubicka in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25776#c9 PR middle-end/25776 * cgraphunit.c (verify_cgraph_node): Typo in error message. Modified: trunk/gcc/ChangeLog trunk/gcc/cgraphunit.c