diff mbox

Support cfi pseudo for debugging on UI_DWARF2 target

Message ID 5d851e9d-6ccb-d555-de27-ac504949616b@adacore.com
State New
Headers show

Commit Message

Tristan Gingold July 28, 2017, 1:33 p.m. UTC
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  <gingold@adacore.com>

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

        enc = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/2, /*global=*/1);
diff mbox

Patch

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)
      {