Commit 9bedc09b by Jakub Jelinek Committed by Jakub Jelinek

dwarf2out.c (any_cfis_emitted): New static variable.

	* dwarf2out.c (any_cfis_emitted): New static variable.
	(add_fde_cfi): Set it.
	(dwarf2out_frame_debug): Clear it before processing,
	if it is set afterwards, flush any queued reg saves.

From-SVN: r164443
parent fbbe0995
2010-09-20 Jakub Jelinek <jakub@redhat.com> 2010-09-20 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (any_cfis_emitted): New static variable.
(add_fde_cfi): Set it.
(dwarf2out_frame_debug): Clear it before processing,
if it is set afterwards, flush any queued reg saves.
PR debug/45124 PR debug/45124
* dwarf2out.c (add_accessibility_attribute): Assume * dwarf2out.c (add_accessibility_attribute): Assume
DW_ACCESS_private as the default for dwarf_version > 2 DW_ACCESS_private as the default for dwarf_version > 2
......
...@@ -800,6 +800,9 @@ dwarf2out_cfi_label (bool force) ...@@ -800,6 +800,9 @@ dwarf2out_cfi_label (bool force)
/* True if remember_state should be emitted before following CFI directive. */ /* True if remember_state should be emitted before following CFI directive. */
static bool emit_cfa_remember; static bool emit_cfa_remember;
/* True if any CFI directives were emitted at the current insn. */
static bool any_cfis_emitted;
/* Add CFI to the current fde at the PC value indicated by LABEL if specified, /* Add CFI to the current fde at the PC value indicated by LABEL if specified,
or to the CIE if LABEL is NULL. */ or to the CIE if LABEL is NULL. */
...@@ -879,6 +882,7 @@ add_fde_cfi (const char *label, dw_cfi_ref cfi) ...@@ -879,6 +882,7 @@ add_fde_cfi (const char *label, dw_cfi_ref cfi)
output_cfi_directive (cfi); output_cfi_directive (cfi);
list_head = &fde->dw_fde_cfi; list_head = &fde->dw_fde_cfi;
any_cfis_emitted = true;
} }
/* ??? If this is a CFI for the CIE, we don't emit. This /* ??? If this is a CFI for the CIE, we don't emit. This
assumes that the standard CIE contents that the assembler assumes that the standard CIE contents that the assembler
...@@ -916,6 +920,7 @@ add_fde_cfi (const char *label, dw_cfi_ref cfi) ...@@ -916,6 +920,7 @@ add_fde_cfi (const char *label, dw_cfi_ref cfi)
} }
list_head = &fde->dw_fde_cfi; list_head = &fde->dw_fde_cfi;
any_cfis_emitted = true;
} }
add_cfi (list_head, cfi); add_cfi (list_head, cfi);
...@@ -2745,6 +2750,7 @@ dwarf2out_frame_debug (rtx insn, bool after_p) ...@@ -2745,6 +2750,7 @@ dwarf2out_frame_debug (rtx insn, bool after_p)
} }
label = dwarf2out_cfi_label (false); label = dwarf2out_cfi_label (false);
any_cfis_emitted = false;
for (note = REG_NOTES (insn); note; note = XEXP (note, 1)) for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
switch (REG_NOTE_KIND (note)) switch (REG_NOTE_KIND (note))
...@@ -2830,7 +2836,11 @@ dwarf2out_frame_debug (rtx insn, bool after_p) ...@@ -2830,7 +2836,11 @@ dwarf2out_frame_debug (rtx insn, bool after_p)
break; break;
} }
if (handled_one) if (handled_one)
return; {
if (any_cfis_emitted)
dwarf2out_flush_queued_reg_saves ();
return;
}
insn = PATTERN (insn); insn = PATTERN (insn);
found: found:
...@@ -2839,7 +2849,7 @@ dwarf2out_frame_debug (rtx insn, bool after_p) ...@@ -2839,7 +2849,7 @@ dwarf2out_frame_debug (rtx insn, bool after_p)
/* Check again. A parallel can save and update the same register. /* Check again. A parallel can save and update the same register.
We could probably check just once, here, but this is safer than We could probably check just once, here, but this is safer than
removing the check above. */ removing the check above. */
if (clobbers_queued_reg_save (insn)) if (any_cfis_emitted || clobbers_queued_reg_save (insn))
dwarf2out_flush_queued_reg_saves (); dwarf2out_flush_queued_reg_saves ();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment