https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93981
--- Comment #7 from Segher Boessenkool <segher at gcc dot gnu.org> --- (In reply to jwjagersma from comment #5) > (In reply to Segher Boessenkool from comment #4) > > Pretending any asm can throw would be a pretty serious code degradation. > > > > Any asm that is not volatile cannot throw (and be correct code). But > > most volatile asm in the wild can never throw, either. > > The intention is to only produce EH info for volatile asms, and only if > -fnon-call-exceptions is given. Asms that take volatile memory operands > should be covered too. Ah right, only for -fnon-call-exceptions, I missed that; that is implied by stmt_can_throw_internal. Why only volatile memory operands, btw? Can't *all* memory accesses throw? Is that handled somewhere else, or does it need special-casing for asm? > Do note that the proposed patch is still incomplete, I ran into an ICE > while building libgcc with -fnon-call-exceptions: > > ``` > during GIMPLE pass: ehcleanup > ../../../gnu/gcc-9.2.0/libgcc/config/i386/sfp-exceptions.c: In function > '__sfp_handle_exceptions': > ../../../gnu/gcc-9.2.0/libgcc/config/i386/sfp-exceptions.c:107:1: internal > compiler error: in mark_reachable_handlers, at tree-eh.c:3929 > 107 | } > | ^ > libbacktrace could not find executable to open > Please submit a full bug report, > with preprocessed source if appropriate. > See <https://gcc.gnu.org/bugs/> for instructions. > ``` > > However I am not knowledgable enough about gcc's inner workings to know > what exactly is missing. I'm hoping someone can help me out with this. Please use trunk ("master") for development, not an older release? I would think the problem here is caused by your modifications to tree-eh.c, but that is not based on understanding this code at all ;-)