Hi,

this patch fixes a thinko in dwarf2out_do_cfi_asm: some targets (x86_64-windows) so support cfi psuedo for debug info, but not dwarf2 exception cfi.

No regressions on x86_64-linux-gnu.

Ok to commit ?

2017-07-28  gingold  <ging...@adacore.com>

        * dwarf2out.c (dwarf2out_do_cfi_startproc): Return early if
        there is a target-specific exception mechanism.

Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c     (revision 250563)
+++ gcc/dwarf2out.c     (working copy)
@@ -958,10 +958,18 @@
 {
   int enc;
   rtx ref;
-  rtx personality = get_personality_function (current_function_decl);

   fprintf (asm_out_file, "\t.cfi_startproc\n");

+ /* Do not emit cfi pseudos for exceptions if DWARF2 mechanism is not used.
+     On most machine, cfi pseudos are also used for DWARF2 debug info, but
+     those for exceptions are supposed to be only used for DWARF2
+     mechanism.  */
+  if (targetm_common.except_unwind_info (&global_options) != UI_DWARF2)
+    return;
+
+  rtx personality = get_personality_function (current_function_decl);
+
   if (personality)
     {
       enc = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/2, /*global=*/1);

Reply via email to