In testing gcc-4.1-20050716 for i686: I originally ran into the following error internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'record_type' in lookup_decl_die, at dwarf2out.c:5461 on the last line of a program. While starting to come up with a minimal test case, I was surprised to find that although I could reproduce that error with preprocessed source, stripping out the lines starting with # produced a different error: x.ii: In instantiation of '__gnu_cxx::rope<char, std::allocator<char> >': x.ii:42429: instantiated from here x.ii:41107: internal compiler error: in force_decl_die, at dwarf2out.c:12621 This is probably fortunate, since it now dies much sooner than at the end of the program. To reproduce this, unpack http://kegel.com/gcc/ice-rope.ii.gz, then compile it with i686-unknown-linux-gnu-gcc -g -Wall -Werror -funsigned-char -c Apologies for not finding a small testcase, and for using a week-old snapshot for testing. Hopefully this is useful anyway.
lookup_decl_die is most likely PR 22034. force_decl_die is most likely PR 22514.
Yep. Compiling PR22034's testcase yields pr22034.cc:6: internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'record_type' in lookup_decl_die, at dwarf2out.c:5461 And compiling pr22514's testcase yields pr22514.cc:11: error: expected unqualified-id before '}' token pr22514.cc: In instantiation of 's::list<1>': pr22514.cc:12: instantiated from here pr22514.cc:8: internal compiler error: in force_decl_die, at dwarf2out.c:12621 So this is a dup. Sorry for the noise.
*** This bug has been marked as a duplicate of 22034 ***
And sure enough, gcc-4.1-20050806 fixes it.