Commit 67d7405e by Richard Henderson Committed by Richard Henderson

re PR target/51552 (bfin generates bad assembly)

PR target/51552
        * dwarf2cfi.c (dwarf2out_frame_debug): Move any_cfis_emitted code...
        (scan_trace): ... here.

From-SVN: r182604
parent c65b0607
2011-12-21 Richard Henderson <rth@redhat.com>
PR target/51552
* dwarf2cfi.c (dwarf2out_frame_debug): Move any_cfis_emitted code...
(scan_trace): ... here.
2011-12-21 Jason Merrill <jason@redhat.com> 2011-12-21 Jason Merrill <jason@redhat.com>
* doc/standards.texi (C++ language): Update for C++11. * doc/standards.texi (C++ language): Update for C++11.
...@@ -1930,9 +1930,6 @@ dwarf2out_frame_debug (rtx insn) ...@@ -1930,9 +1930,6 @@ dwarf2out_frame_debug (rtx insn)
{ {
rtx note, n; rtx note, n;
bool handled_one = false; bool handled_one = false;
bool need_flush = 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))
...@@ -2020,8 +2017,7 @@ dwarf2out_frame_debug (rtx insn) ...@@ -2020,8 +2017,7 @@ dwarf2out_frame_debug (rtx insn)
break; break;
case REG_CFA_FLUSH_QUEUE: case REG_CFA_FLUSH_QUEUE:
/* The actual flush happens below. */ /* The actual flush happens elsewhere. */
need_flush = true;
handled_one = true; handled_one = true;
break; break;
...@@ -2029,13 +2025,7 @@ dwarf2out_frame_debug (rtx insn) ...@@ -2029,13 +2025,7 @@ dwarf2out_frame_debug (rtx insn)
break; break;
} }
if (handled_one) if (!handled_one)
{
/* Minimize the number of advances by emitting the entire queue
once anything is emitted. */
need_flush |= any_cfis_emitted;
}
else
{ {
insn = PATTERN (insn); insn = PATTERN (insn);
do_frame_expr: do_frame_expr:
...@@ -2044,12 +2034,9 @@ dwarf2out_frame_debug (rtx insn) ...@@ -2044,12 +2034,9 @@ dwarf2out_frame_debug (rtx insn)
/* 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 at the start of the function. */ removing the check at the start of the function. */
if (any_cfis_emitted || clobbers_queued_reg_save (insn)) if (clobbers_queued_reg_save (insn))
need_flush = true;
}
if (need_flush)
dwarf2out_flush_queued_reg_saves (); dwarf2out_flush_queued_reg_saves ();
}
} }
/* Emit CFI info to change the state from OLD_ROW to NEW_ROW. */ /* Emit CFI info to change the state from OLD_ROW to NEW_ROW. */
...@@ -2489,6 +2476,7 @@ scan_trace (dw_trace_info *trace) ...@@ -2489,6 +2476,7 @@ scan_trace (dw_trace_info *trace)
/* Make sure any register saves are visible at the jump target. */ /* Make sure any register saves are visible at the jump target. */
dwarf2out_flush_queued_reg_saves (); dwarf2out_flush_queued_reg_saves ();
any_cfis_emitted = false;
/* However, if there is some adjustment on the call itself, e.g. /* However, if there is some adjustment on the call itself, e.g.
a call_pop, that action should be considered to happen after a call_pop, that action should be considered to happen after
...@@ -2508,6 +2496,7 @@ scan_trace (dw_trace_info *trace) ...@@ -2508,6 +2496,7 @@ scan_trace (dw_trace_info *trace)
|| clobbers_queued_reg_save (insn) || clobbers_queued_reg_save (insn)
|| find_reg_note (insn, REG_CFA_FLUSH_QUEUE, NULL)) || find_reg_note (insn, REG_CFA_FLUSH_QUEUE, NULL))
dwarf2out_flush_queued_reg_saves (); dwarf2out_flush_queued_reg_saves ();
any_cfis_emitted = false;
add_cfi_insn = insn; add_cfi_insn = insn;
scan_insn_after (insn); scan_insn_after (insn);
...@@ -2518,6 +2507,12 @@ scan_trace (dw_trace_info *trace) ...@@ -2518,6 +2507,12 @@ scan_trace (dw_trace_info *trace)
emitted two cfa adjustments. Do it now. */ emitted two cfa adjustments. Do it now. */
def_cfa_1 (&this_cfa); def_cfa_1 (&this_cfa);
/* Minimize the number of advances by emitting the entire queue
once anything is emitted. */
if (any_cfis_emitted
|| find_reg_note (insn, REG_CFA_FLUSH_QUEUE, NULL))
dwarf2out_flush_queued_reg_saves ();
/* Note that a test for control_flow_insn_p does exactly the /* Note that a test for control_flow_insn_p does exactly the
same tests as are done to actually create the edges. So same tests as are done to actually create the edges. So
always call the routine and let it not create edges for always call the routine and let it not create edges for
......
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