This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9769: [3.2/3.3 regression] miscompilation with -freg-struct-return
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, jbakker at rssd dot esa dot int, nobody at gcc dot gnu dot org, ulammers at rssd dot esa dot int
- Date: 7 Mar 2003 02:08:46 -0000
- Subject: Re: c++/9769: [3.2/3.3 regression] miscompilation with -freg-struct-return
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, jbakker at rssd dot esa dot int, nobody at gcc dot gnu dot org, ulammers at rssd dot esa dot int, gcc-gnats at gcc dot gnu dot org
Old Synopsis: compiles wrong code but executable SEGV with -freg-struct-return
New Synopsis: [3.2/3.3 regression] miscompilation with -freg-struct-return
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Fri Mar 7 02:08:46 2003
State-Changed-Why:
Confirmed with 3.2.2 and 3.3. It works with 3.0 and
present mainline. However, I admit that I am unclear
about whether this is an ABI-incompatible switch: does
one need to recompile libstdc++ when one wants to use it?
The docs are not entirely clear about this.
At any rate, here's a backtrace of where the program
crashes:
#0 std::string::_M_iend() const (this=0x19)
at /home/bangerth/tmp/gcc/bin/i686-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:249
#1 0x08048f39 in std::string& std::string::append<char const*>(char const*, char const*) (this=0xbffff174, __first=0x8048fbc "*** ", __last=0x8048fc0 "")
at /home/bangerth/bin/gcc-3.3-pre/include/c++/3.3/bits/basic_string.h:492
#2 0x08048ee9 in std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (__lhs=0x8048fbc "*** ", __rhs= at 0xbffff184)
at /home/bangerth/bin/gcc-3.3-pre/include/c++/3.3/bits/basic_string.tcc:620
#3 0x08048d61 in main () at x.cc:7
#4 0x4012a9ed in __libc_start_main () from /lib/libc.so.6
Obviously, the this pointer in frame 0 is botched up.
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9769