From: "ldb" <ldb_nospam@hotmail.com>
Subject: Exception propagation with optimization flags
Date: 3 Oct 2006 15:18:19 -0700
Date: 2006-10-03T15:18:19-07:00 [thread overview]
Message-ID: <1159913899.620229.69760@m73g2000cwd.googlegroups.com> (raw)
Can someone explain why this particular combinations of build flags
causes exceptions to stop propagating. I'm kind of at a loss for this.
This is a nested function, which raises, catches, prints some info and
reraises an exception, and a main program which is trying to catch this
exception, to print some further information. I've created a "minimal"
program to show the problem. This is gnatmake/gcc 3.4.5.
And, if anyone is an expert, can you explain to me the connection (if
there is one) with "libunwind-exceptions" in my gcc ./configure.
When I build with -O2 and -fomit-frame-pointer I get this:
EXCEPTION
raised SUPER.AWESOME.AWESOME_EXCEPTION : super.adb:12
If I remove -fomit-frame-pointer _or_ go down to -O1 (both o2 and fomit
are required to get the behavior), I get this:
EXCEPTION
HOLY MOLY
---------------------
with Ada.Text_Io; use Ada.Text_Io;
procedure Super is
procedure Awesome is
Awesome_Exception : exception;
begin
raise Awesome_Exception;
exception
when others =>
Put_Line("EXCEPTION");
raise Awesome_Exception;
end Awesome;
begin
Awesome;
exception
when others=>
Put_Line("HOLY MOLY");
end Super;
---------------------
next reply other threads:[~2006-10-03 22:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-03 22:18 ldb [this message]
2006-10-04 12:36 ` Exception propagation with optimization flags Stephen Leake
2006-10-04 13:31 ` ldb
2006-10-04 15:09 ` Georg Bauhaus
2006-10-04 16:33 ` Stefan Bellon
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox