public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/27098] New: throw cause terminate() instead of catch
@ 2006-04-10 3:35 mlazar at kma dot zcu dot cz
2006-04-10 3:37 ` [Bug c++/27098] " mlazar at kma dot zcu dot cz
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: mlazar at kma dot zcu dot cz @ 2006-04-10 3:35 UTC (permalink / raw)
To: gcc-bugs
I have two files. One in c compiled with gcc, and other in c++ compiled with
g++. From c++ is called helper function in c with pointer to error handler as
parameter. Error handler (in c++) execute throw, but it is not catched as I
expected. Instead is called default terminate() function.
I observe this bug on i685 in gcc-2.95 (debian), gcc-3.3.6 (debian), gcc-3.4.5
(gentoo), gcc-3.4.6 (ubuntu) and gcc-4.0.3 (ubuntu).
I also tested it on x86_64 in gcc-3.3.3 (SuSE). With -m32 i get this error but
with -m64 the exception is catched!
--
Summary: throw cause terminate() instead of catch
Product: gcc
Version: 4.0.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mlazar at kma dot zcu dot cz
GCC build triplet: i486-pc-linux-gnu
GCC host triplet: i486-pc-linux-gnu
GCC target triplet: i486-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27098
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/27098] throw cause terminate() instead of catch
2006-04-10 3:35 [Bug c++/27098] New: throw cause terminate() instead of catch mlazar at kma dot zcu dot cz
@ 2006-04-10 3:37 ` mlazar at kma dot zcu dot cz
2006-04-10 3:38 ` mlazar at kma dot zcu dot cz
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: mlazar at kma dot zcu dot cz @ 2006-04-10 3:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from mlazar at kma dot zcu dot cz 2006-04-10 03:37 -------
Created an attachment (id=11232)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11232&action=view)
c++ part of bug-demonstration program
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27098
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/27098] throw cause terminate() instead of catch
2006-04-10 3:35 [Bug c++/27098] New: throw cause terminate() instead of catch mlazar at kma dot zcu dot cz
2006-04-10 3:37 ` [Bug c++/27098] " mlazar at kma dot zcu dot cz
@ 2006-04-10 3:38 ` mlazar at kma dot zcu dot cz
2006-04-10 3:41 ` mlazar at kma dot zcu dot cz
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: mlazar at kma dot zcu dot cz @ 2006-04-10 3:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from mlazar at kma dot zcu dot cz 2006-04-10 03:38 -------
Created an attachment (id=11233)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11233&action=view)
c part of bug-demonstration program
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27098
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/27098] throw cause terminate() instead of catch
2006-04-10 3:35 [Bug c++/27098] New: throw cause terminate() instead of catch mlazar at kma dot zcu dot cz
2006-04-10 3:37 ` [Bug c++/27098] " mlazar at kma dot zcu dot cz
2006-04-10 3:38 ` mlazar at kma dot zcu dot cz
@ 2006-04-10 3:41 ` mlazar at kma dot zcu dot cz
2006-04-10 4:15 ` mlazar at kma dot zcu dot cz
2006-04-10 16:28 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: mlazar at kma dot zcu dot cz @ 2006-04-10 3:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from mlazar at kma dot zcu dot cz 2006-04-10 03:41 -------
Created an attachment (id=11234)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11234&action=view)
Compiler versions and configurations
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27098
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/27098] throw cause terminate() instead of catch
2006-04-10 3:35 [Bug c++/27098] New: throw cause terminate() instead of catch mlazar at kma dot zcu dot cz
` (2 preceding siblings ...)
2006-04-10 3:41 ` mlazar at kma dot zcu dot cz
@ 2006-04-10 4:15 ` mlazar at kma dot zcu dot cz
2006-04-10 16:28 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: mlazar at kma dot zcu dot cz @ 2006-04-10 4:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from mlazar at kma dot zcu dot cz 2006-04-10 04:15 -------
I observed that if the c source is compiled with "-foptimize-sibling-calls -O"
options (on i686 in gcc 4.0.3), the exception is catched.
So in this case, the terminate() function call:
gcc -c helper.c
g++ helper.o main.cc -o main
and this case, the exception is catched:
gcc -c helper.c -O -foptimize-sibling-calls
g++ helper.o main.cc -o main
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27098
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/27098] throw cause terminate() instead of catch
2006-04-10 3:35 [Bug c++/27098] New: throw cause terminate() instead of catch mlazar at kma dot zcu dot cz
` (3 preceding siblings ...)
2006-04-10 4:15 ` mlazar at kma dot zcu dot cz
@ 2006-04-10 16:28 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-04-10 16:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2006-04-10 16:28 -------
*** This bug has been marked as a duplicate of 11813 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27098
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-04-10 16:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-10 3:35 [Bug c++/27098] New: throw cause terminate() instead of catch mlazar at kma dot zcu dot cz
2006-04-10 3:37 ` [Bug c++/27098] " mlazar at kma dot zcu dot cz
2006-04-10 3:38 ` mlazar at kma dot zcu dot cz
2006-04-10 3:41 ` mlazar at kma dot zcu dot cz
2006-04-10 4:15 ` mlazar at kma dot zcu dot cz
2006-04-10 16:28 ` pinskia at gcc dot gnu dot org
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).