https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64711
--- Comment #6 from rguenther at suse dot de <rguenther at suse dot de> --- On Thu, 12 Nov 2020, ebotcazou at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64711 > > --- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- > > as the comments says the check isn't correct but it might work for simple > > non-LTO cases. Anybody willing to try? > > But isn't LTO towards being the default these days? If so, what's the point > of > punishing every function for something that doesn't really work with LTO? > > Cannot we clear the nothrow flag on the functions selectively instead? Well, if this is the place to fix we can figure a way to check it correctly. The issue with clearing nothrow is that those pesky builtins have that "sticky" while the per-stmt flag (gimple_call_nothrow ()) just amends it. Guess we might want to fix that (in gimple_call_flags) and then clear the flag always for -fnon-call-exceptions? I suppose all/most noexcept specifications in libstdc++ are similarly questionable.