c++/2814: dwarf2out problems when -g1 is combined with -fpic on i686-linux

Daniel Berlin dan@cgsoftware.com
Fri Jun 15 21:38:00 GMT 2001


Jeff Sturm <jsturm@one-point.com> writes:

Hmmmm. This one is cute.
Somehow, in our fun attempt to just output debug info for functions
and external variables, but no local variables, no line numbers, no
typedefs, etc, we run into the follow:

We end up putting a member function as the child of a compile unit.
When we then go to output the member dies for that class type, we go
to do the splice, notice that the parent of the member function is a
compile unit, and abort.

So the actual wrong thing occurs when we put the subprogram as the
child of the compile unit (in this case, anyway. It has no
specification, etc that says "I'm really the real info about this
function over here" pointing to the member function inside a class
die)..

I'll track this down when I get a chance, if someone doesn't beat me
to it.

However, using dwarf2 with -g1 seems pretty silly anyway.  We
get the same info from the exported ELF symbols, since we are on
i686-linux.  In other words, this shouldn't do anything more for you in the
way of backtraces on this particular platform.



>>
>> Synopsis: dwarf2out problems when -g1 is combined with -fpic on i686-linux
>> 
>> State-Changed-From-To: open->feedback
>> State-Changed-By: rodrigc
>> State-Changed-When: Fri Jun 15 17:21:42 2001
>> State-Changed-Why:
>>     I get lots of
>>     compilation errors when trying to
>>     compile your preprocessed source with a newer
>>     gcc 3.0 snapshot.  Can you
>>     try a newer snapshot of gcc 3.0?
> 
> Similar failures have been reported for java on IA-64.  It seems to be
> reproducible on any target with -gdwarf-2.  Here's a short, unpreprocessed
> example with the 3.0 prerelease:
> 
> [jsturm@mars jsturm]$ cat e.cc
> #include <iostream>
> 
> using namespace std;
> 
> int main(void) {
> 	cout << "hello world" << endl;
>}
> 
> [jsturm@mars jsturm]$ g++ -gdwarf-2 -g1 -c e.cc
> /opt/gcc/include/g++-v3/bits/std_memory.h: In constructor 
>    `std::auto_ptr<_Tp>::auto_ptr(_Tp*) [with _Tp = std::_Format_cache<char>]':
> /opt/gcc/include/g++-v3/bits/std_memory.h:43:   instantiated from `std::auto_ptr<_Tp>::auto_ptr(_Tp*) [with _Tp = std::_Format_cache<char>]'
> /opt/gcc/include/g++-v3/bits/locale_facets.tcc:219:   instantiated from `static std::_Format_cache<_CharT>* std::_Format_cache<_CharT>::_S_get(std::ios_base&) [with _CharT = char]'
> /opt/gcc/include/g++-v3/bits/ostream.tcc:477:   instantiated from `void std::__pad_char(std::basic_ios<_CharT, _Traits>&, _CharT*, const _CharT*, long int, long int) [with _CharT = char, _Traits = std::char_traits<char>]'
> /opt/gcc/include/g++-v3/bits/std_ostream.h:688:   instantiated from `std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*) [with _Traits = std::char_traits<char>]'
> e.cc:6:   instantiated from here
> /opt/gcc/include/g++-v3/bits/std_memory.h:43: Internal compiler error in 
>    splice_child_die, at dwarf2out.c:4712
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.
> 
> Jeff
> 

-- 
"I can levitate birds.  No one cares.
"-Steven Wright



More information about the Gcc-bugs mailing list