https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88159
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I don't think this is a bug. By default with the C front-end, -fexceptions is turned off. While with the C++ front-end, it is turned on. With -O2, run contains a tail called function which just makes this work by accident as the backtracing turns out that run is not on the call stack any more. With -flto, the function run is inlined with a nothrow around it and you end up with no exception information so there is no where to catch it. If you used -fexceptions with the C code, it will work correctly.