dwarf2out.c (emit_cfa_remember): New variable.

* dwarf2out.c (emit_cfa_remember): New variable.
	(add_fde_cfi): If emit_cfa_remember, recurse to add
	DW_CFA_remember_state first.
	(dwarf2out_begin_epilogue): Don't add_fde_cfi DW_CFA_remember_state,
	instead just set emit_cfa_remember.

From-SVN: r148298
This commit is contained in:
Jakub Jelinek 2009-06-09 00:39:32 +02:00 committed by Jakub Jelinek
parent d7f26adfaf
commit 8845deabba
2 changed files with 26 additions and 6 deletions

View file

@ -1,3 +1,11 @@
2009-06-08 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (emit_cfa_remember): New variable.
(add_fde_cfi): If emit_cfa_remember, recurse to add
DW_CFA_remember_state first.
(dwarf2out_begin_epilogue): Don't add_fde_cfi DW_CFA_remember_state,
instead just set emit_cfa_remember.
2009-06-08 Jan Hubicka <jh@suse.cz>
PR debug/40126

View file

@ -717,13 +717,29 @@ dwarf2out_cfi_label (bool force)
return label;
}
/* True if remember_state should be emitted before following CFI directive. */
static bool emit_cfa_remember;
/* Add CFI to the current fde at the PC value indicated by LABEL if specified,
or to the CIE if LABEL is NULL. */
static void
add_fde_cfi (const char *label, dw_cfi_ref cfi)
{
dw_cfi_ref *list_head = &cie_cfi_head;
dw_cfi_ref *list_head;
if (emit_cfa_remember)
{
dw_cfi_ref cfi_remember;
/* Emit the state save. */
emit_cfa_remember = false;
cfi_remember = new_cfi ();
cfi_remember->dw_cfi_opc = DW_CFA_remember_state;
add_fde_cfi (label, cfi_remember);
}
list_head = &cie_cfi_head;
if (dwarf2out_do_cfi_asm ())
{
@ -2709,7 +2725,6 @@ dwarf2out_begin_epilogue (rtx insn)
{
bool saw_frp = false;
rtx i;
dw_cfi_ref cfi;
/* Scan forward to the return insn, noticing if there are possible
frame related insns. */
@ -2755,10 +2770,7 @@ dwarf2out_begin_epilogue (rtx insn)
}
emit_note_before (NOTE_INSN_CFA_RESTORE_STATE, i);
/* Emit the state save. */
cfi = new_cfi ();
cfi->dw_cfi_opc = DW_CFA_remember_state;
add_fde_cfi (dwarf2out_cfi_label (false), cfi);
emit_cfa_remember = true;
/* And emulate the state save. */
gcc_assert (!cfa_remember.in_use);