https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534

--- Comment #27 from Lukas Grätz <lukas.gra...@tu-darmstadt.de> ---
(In reply to Jakub Jelinek from comment #26)
> (In reply to Lukas Grätz from comment #25)
> > (In reply to Jakub Jelinek from comment #19)
> > > (In reply to H.J. Lu from comment #18)
> > > > (In reply to Jakub Jelinek from comment #17)
> > > > > E.g. shouldn't it at least be disabled for -O0 and -Og and shouldn't 
> > > > > we
> > > > 
> > > > We can disable this for -O0 and -Og.
> > > 
> > > I think we should go for that.
> > > 
> > 
> > This is independent from debugging, but I thought the patch was only meant
> > for -O3. Have you thought about the following situation:
> 
> Throwing an exception through -fno-exceptions code is UB, don't do that.

Thanks for the info!

I guess this UB is implicit in GCC's documentation for "-fexceptions":

"However, you may need to enable this option when compiling C code that needs
to interoperate properly with exception handlers written in C++."

I would suggest to remove the "may" and to be more clear:

"However, you need to enable this option when compiling C code that could
(implicitly) propagate an exception (from C++) to an exception handler written
in C++."

Reply via email to