https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93981
--- Comment #8 from jwjagersma at gmail dot com --- (In reply to Segher Boessenkool from comment #7) > 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? Memory access from a known valid pointer (eg. stack variables) can reasonably be expected not to throw. So I didn't mean 'volatile' in the literal sense but more in general, pointers that cannot be know to be valid at compile-time. > Is that handled somewhere else, or does it need special-casing for asm? For general memory access I think this is checked in tree_could_trap_p. The case for ASM_EXPR there would need to be expanded to check if any of its operands could trap. > Please use trunk ("master") for development, not an older release? I was having trouble building a native (mingw-w64) compiler from git, so I tried using 9.2.0 sources. I'm working on trunk now using an Ubuntu VM. > 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 ;-) To me it seems that some part of the code does not realize that a throwing asm must be kept at a bb boundary, and inserts statements after it. That would need to be patched too, if I could find where that happens.