This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/384: Re: g++ optimizer and exceptions ...
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/384: Re: g++ optimizer and exceptions ...
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Thu, 6 Jul 2000 09:26:16 +0200
- References: <394E3A54.EE7E2817@iue.tuwien.ac.at>
- Resent-Cc: gcc-prs at gcc dot gnu dot org, jason at gcc dot gnu dot org, binder at iue dot tuwien dot ac dot at
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de>
>Number: 384
>Category: c++
>Synopsis: g++ optimizer and exceptions ...
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: analyzed
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Thu Jul 06 00:26:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Thomas Binder <binder@iue.tuwien.ac.at>
>Release: 2.95.2
>Organization:
IuE
>Environment:
>Description:
Original-Message-ID: <394E3A54.EE7E2817@iue.tuwien.ac.at>
Date: Mon, 19 Jun 2000 17:20:52 +0200
Hallo folks!
There seems to be a bug in the optimizer of g++. The combination of -O2 and
-fomit-frame-pointer results in a segmentation violation or in an illegal
instruction in some cases of exception handling.
This occurrs in egcs-1.1.2, gcc-2.95 and gcc-2.95-2 (and possibly on older
versions) on architectures Linux and HP-UX. I also tested on Solaris and OSF
which both worked fine. The attached programs (buf-segv.cc and bug-ill.cc) will
produce the mentioned errors.
The bug-ill program only produced a SIGILL with egcs-1.1.2 on RH-6.1 and
segfaulted in all other cases.
regards,
T.Binder
==================== bug-segv.cc ========================
struct AnException
{
AnException()
{}
};
struct BClass
{
BClass()
{
throw AnException();
}
};
int main()
{
try
{
BClass bc;
}
catch(...)
{
}
}
========================================================
=================== bug-ill.cc =========================
struct AClass
{
AClass();
};
struct BClass
{
BClass();
};
struct AnException
{
AnException()
{}
};
int main()
{
try
{
AClass ac;
BClass bc;
}
catch(...)
{
}
}
BClass::BClass()
{
throw AnException();
}
AClass::AClass()
{
}
=======================================================
--
"Computers are like air conditioners - they stop working properly when you open
Windows"
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: