diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-09-20 18:49:58 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-09-20 18:49:58 +0200 |
commit | 9bedc09b131799f532678275534ff774a088721a (patch) | |
tree | 8509eac49f7a4e233128ec5c5c742ca95daca287 | |
parent | fbbe0995b838343660140bce022165bc7976edb2 (diff) | |
download | gcc-9bedc09b131799f532678275534ff774a088721a.zip gcc-9bedc09b131799f532678275534ff774a088721a.tar.gz gcc-9bedc09b131799f532678275534ff774a088721a.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 14 |
2 files changed, 17 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2ad185b..68ddcf8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 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 * dwarf2out.c (add_accessibility_attribute): Assume DW_ACCESS_private as the default for dwarf_version > 2 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 963ba1f..908d015 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -800,6 +800,9 @@ dwarf2out_cfi_label (bool force) /* True if remember_state should be emitted before following CFI directive. */ 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, or to the CIE if LABEL is NULL. */ @@ -879,6 +882,7 @@ add_fde_cfi (const char *label, dw_cfi_ref cfi) output_cfi_directive (cfi); list_head = &fde->dw_fde_cfi; + any_cfis_emitted = true; } /* ??? If this is a CFI for the CIE, we don't emit. This assumes that the standard CIE contents that the assembler @@ -916,6 +920,7 @@ add_fde_cfi (const char *label, dw_cfi_ref cfi) } list_head = &fde->dw_fde_cfi; + any_cfis_emitted = true; } add_cfi (list_head, cfi); @@ -2745,6 +2750,7 @@ dwarf2out_frame_debug (rtx insn, bool after_p) } label = dwarf2out_cfi_label (false); + any_cfis_emitted = false; for (note = REG_NOTES (insn); note; note = XEXP (note, 1)) switch (REG_NOTE_KIND (note)) @@ -2830,7 +2836,11 @@ dwarf2out_frame_debug (rtx insn, bool after_p) break; } if (handled_one) - return; + { + if (any_cfis_emitted) + dwarf2out_flush_queued_reg_saves (); + return; + } insn = PATTERN (insn); found: @@ -2839,7 +2849,7 @@ dwarf2out_frame_debug (rtx insn, bool after_p) /* Check again. A parallel can save and update the same register. We could probably check just once, here, but this is safer than removing the check above. */ - if (clobbers_queued_reg_save (insn)) + if (any_cfis_emitted || clobbers_queued_reg_save (insn)) dwarf2out_flush_queued_reg_saves (); } |