From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5435 invoked by alias); 7 Mar 2003 02:08:47 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 5415 invoked by uid 48); 7 Mar 2003 02:08:46 -0000 Date: Fri, 07 Mar 2003 02:08:00 -0000 Message-ID: <20030307020846.5414.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, jbakker@rssd.esa.int, nobody@gcc.gnu.org, ulammers@rssd.esa.int From: bangerth@dealii.org Reply-To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, jbakker@rssd.esa.int, nobody@gcc.gnu.org, ulammers@rssd.esa.int, gcc-gnats@gcc.gnu.org Subject: Re: c++/9769: [3.2/3.3 regression] miscompilation with -freg-struct-return X-SW-Source: 2003-03/txt/msg00326.txt.bz2 List-Id: 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*) (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, std::allocator > std::operator+, std::allocator >(char const*, std::basic_string, std::allocator > const&) (__lhs=0x8048fbc "*** ", __rhs=@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