https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91794
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Eric Botcazou from comment #5) > > Eric - was the intent of the PR81351 fix that the dwarf2out_do_eh_frame () > > works per function? > > No, dwarf2out_do_eh_frame is global but whether the CFI for EH is emitted is > decided on a per-function basis in the end, see my explanation in: > https://gcc.gnu.org/ml/gcc-patches/2017-11/msg00771.html Hmm, that doesn't give a lot of detail. Clearly it doesn't yet work. I see dwarf2out_do_eh_frame is also used as gate for the "dwarf2" pass. That probably should use per-function settings then, thus an alternate predicate? Because the global setting simply tells the assembler to either emit everything into eh_frame or debug_frame (seems the assembler cannot have different settings on a per function basis?). So I guess an appropriate cleanup would be to pass a struct function to dwarf2out_do_eh_frame but also deal with it being NULL?