public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/3757: 3.0 does not destroy local objects on throw
@ 2001-08-03 16:28 rth
0 siblings, 0 replies; 3+ messages in thread
From: rth @ 2001-08-03 16:28 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, mmitchel, rth, teemu
Synopsis: 3.0 does not destroy local objects on throw
Responsible-Changed-From-To: mmitchel->rth
Responsible-Changed-By: rth
Responsible-Changed-When: Fri Aug 3 16:28:05 2001
Responsible-Changed-Why:
Mine.
State-Changed-From-To: analyzed->closed
State-Changed-By: rth
State-Changed-When: Fri Aug 3 16:28:05 2001
State-Changed-Why:
http://gcc.gnu.org/ml/gcc-patches/2001-08/msg00189.html
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3757&database=gcc
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/3757: 3.0 does not destroy local objects on throw
@ 2001-07-23 11:20 mmitchel
0 siblings, 0 replies; 3+ messages in thread
From: mmitchel @ 2001-07-23 11:20 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, mmitchel, nobody, teemu
Synopsis: 3.0 does not destroy local objects on throw
Responsible-Changed-From-To: unassigned->mmitchel
Responsible-Changed-By: mmitchel
Responsible-Changed-When: Mon Jul 23 11:20:38 2001
Responsible-Changed-Why:
Working on a fix.
State-Changed-From-To: open->analyzed
State-Changed-By: mmitchel
State-Changed-When: Mon Jul 23 11:20:38 2001
State-Changed-Why:
Confirmed as regression.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3757&database=gcc
^ permalink raw reply [flat|nested] 3+ messages in thread
* c++/3757: 3.0 does not destroy local objects on throw
@ 2001-07-21 2:16 teemu
0 siblings, 0 replies; 3+ messages in thread
From: teemu @ 2001-07-21 2:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 3757
>Category: c++
>Synopsis: 3.0 does not destroy local objects on throw
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Sat Jul 21 02:16:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Teemu Torma
>Release: 3.0.1 20010720 (prerelease)
>Organization:
>Environment:
System: Linux dirham.labs.trema.com 2.4.6 #1 SMP Thu Jul 5 15:25:57 CEST 2001 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-3.0-branch/configure --with-gcc-version-trigger=/work/tot/gcc/3.0/gcc-3.0-branch/gcc/version.c --host=i686-pc-linux-gnu --prefix=/usr/local/gcc3 --enable-version-specific-runtime-libs --enable-long-long --enable-threads
>Description:
Local objects are not always destructed when an exception is
thrown and the object goes out of scope.
>How-To-Repeat:
Please see the following code. In ex_test, the local object
is not destructed if e1 is thrown, but is, if e2 would be
thrown. No compiler options are needed to reproduce the problem.
$ /usr/local/gcc3/bin/c++ -v ex.cc
Reading specs from /usr/local/gcc3/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/specs
Configured with: ../gcc-3.0-branch/configure --with-gcc-version-trigger=/work/tot/gcc/3.0/gcc-3.0-branch/gcc/version.c --host=i686-pc-linux-gnu --prefix=/usr/local/gcc3 --enable-version-specific-runtime-libs --enable-long-long --enable-threads
Thread model: posix
gcc version 3.0.1 20010720 (prerelease)
/usr/local/gcc3/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=1 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ ex.cc -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase ex.cc -version -o /tmp/ccVtUJdM.sGNU CPP version 3.0.1 20010720 (prerelease) (cpplib) (i386 Linux/ELF)
GNU C++ version 3.0.1 20010720 (prerelease) (i686-pc-linux-gnu)
compiled by GNU C version 3.0.1 20010720 (prerelease).
#include "..." search starts here:
#include <...> search starts here:
/usr/local/gcc3/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/include/g++
/usr/local/gcc3/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/include/g++/i686-pc-linux-gnu
/usr/local/gcc3/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/include/g++/backward
/usr/local/include
/usr/local/gcc3/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/include
/usr/local/gcc3/i686-pc-linux-gnu/include
/usr/include
End of search list.
as --traditional-format -V -Qy -o /tmp/ccG2tDMQ.o /tmp/ccVtUJdM.s
GNU assembler version 2.10.91 (i386-redhat-linux) using BFD version 2.10.1.0.2
/usr/local/gcc3/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/gcc3/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/crtbegin.o -L/usr/local/gcc3/lib/gcc-lib/i686-pc-linux-gnu/3.0.1 -L/usr/local/gcc3/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/../../.. /tmp/ccG2tDMQ.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/local/gcc3/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/crtend.o /usr/lib/crtn.o
$ ./a.out
a::a()
$
#include <iostream>
using namespace std;
struct a
{
a () { cerr << "a::a()\n"; }
~a () { cerr << "a::~a()\n"; }
};
struct e1 {};
struct e2 {};
void
ex_test ()
{
a aa;
try
{
// If this would be e2, aa would be destructed.
throw e1 ();
}
catch (e2 &)
{
}
}
int
main ()
{
try
{
ex_test ();
}
catch (...)
{
}
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-08-03 16:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-03 16:28 c++/3757: 3.0 does not destroy local objects on throw rth
-- strict thread matches above, loose matches on Subject: below --
2001-07-23 11:20 mmitchel
2001-07-21 2:16 teemu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).