https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91794

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
So one possible fix would be

Index: gcc/dwarf2cfi.c
===================================================================
--- gcc/dwarf2cfi.c     (revision 275639)
+++ gcc/dwarf2cfi.c     (working copy)
@@ -3489,7 +3489,7 @@ bool
 dwarf2out_do_eh_frame (void)
 {
   return
-    (flag_unwind_tables || flag_exceptions)
+    (opt_for_fn (cfun->decl, flag_unwind_tables) || flag_exceptions)
     && targetm_common.except_unwind_info (&global_options) == UI_DWARF2;
 }

note this predicate also controls the 'dwarf2' RTL pass so you'd get
per function CFI notes(?).

Reply via email to