This is the mail archive of the
mailing list for the GCC project.
Re: C++: Letting compiler know asm block can call function that can throw?
On Thu, 29 Mar 2012, Stephan Bergmann wrote:
> > > Anyway, would it be worthwhile filing an RFE for an asm annotation
> > > telling the compiler that it contains code that can throw?
> > I suppose yes.
> <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52770> "RFE: Letting
> compiler know asm block can call function that can throw."
Actually, with -fnon-call-exceptions volatile asms are already supposed to
be throwing. It's just that this got lost with tree-ssa. With the patch
and -fnon-call-exceptions a simple "__asm__ volatile (...)" is regarded as
Without -fnon-call-exceptions some parser changes would be required. How
about "asm throw (...)" ?
--- tree-eh.c (revision 183716)
+++ tree-eh.c (working copy)
@@ -1959,6 +1959,7 @@ lower_eh_constructs_2 (struct leh_state
/* FALLTHRU */
+ case GIMPLE_ASM:
/* If the stmt can throw use a new temporary for the assignment
to a LHS. This makes sure the old value of the LHS is
--- tree-cfg.c (revision 183716)
+++ tree-cfg.c (working copy)
@@ -580,6 +580,8 @@ make_edges (void)
+ if (is_ctrl_altering_stmt (last))
+ make_eh_edges (last);
fallthru = true;