Commit 5f262d13 by Alexandre Oliva Committed by Alexandre Oliva

re PR debug/45656 (gfortran.dg/forall_4.f90 -O3, wrong code with -g)

PR debug/45656
* cse.c (cse_extended_basic_block): Preserve cc0 info across
debug isnsn.  Skip them when searching for cc0 setter.
(set_live_p): Skip debug insns when searching for cc0 user.

From-SVN: r165150
parent 7de9e0a1
2010-10-08 Alexandre Oliva <aoliva@redhat.com> 2010-10-08 Alexandre Oliva <aoliva@redhat.com>
PR debug/45656
* cse.c (cse_extended_basic_block): Preserve cc0 info across
debug isnsn. Skip them when searching for cc0 setter.
(set_live_p): Skip debug insns when searching for cc0 user.
2010-10-08 Alexandre Oliva <aoliva@redhat.com>
PR debug/45673 PR debug/45673
PR debug/45604 PR debug/45604
PR debug/45419 PR debug/45419
...@@ -6348,29 +6348,31 @@ cse_extended_basic_block (struct cse_basic_block_data *ebb_data) ...@@ -6348,29 +6348,31 @@ cse_extended_basic_block (struct cse_basic_block_data *ebb_data)
recorded_label_ref = true; recorded_label_ref = true;
#ifdef HAVE_cc0 #ifdef HAVE_cc0
/* If the previous insn set CC0 and this insn no longer if (NONDEBUG_INSN_P (insn))
references CC0, delete the previous insn. Here we use
fact that nothing expects CC0 to be valid over an insn,
which is true until the final pass. */
{
rtx prev_insn, tem;
prev_insn = PREV_INSN (insn);
if (prev_insn && NONJUMP_INSN_P (prev_insn)
&& (tem = single_set (prev_insn)) != 0
&& SET_DEST (tem) == cc0_rtx
&& ! reg_mentioned_p (cc0_rtx, PATTERN (insn)))
delete_insn (prev_insn);
}
/* If this insn is not the last insn in the basic block,
it will be PREV_INSN(insn) in the next iteration. If
we recorded any CC0-related information for this insn,
remember it. */
if (insn != BB_END (bb))
{ {
prev_insn_cc0 = this_insn_cc0; /* If the previous insn sets CC0 and this insn no
prev_insn_cc0_mode = this_insn_cc0_mode; longer references CC0, delete the previous insn.
Here we use fact that nothing expects CC0 to be
valid over an insn, which is true until the final
pass. */
rtx prev_insn, tem;
prev_insn = prev_nonnote_nondebug_insn (insn);
if (prev_insn && NONJUMP_INSN_P (prev_insn)
&& (tem = single_set (prev_insn)) != NULL_RTX
&& SET_DEST (tem) == cc0_rtx
&& ! reg_mentioned_p (cc0_rtx, PATTERN (insn)))
delete_insn (prev_insn);
/* If this insn is not the last insn in the basic
block, it will be PREV_INSN(insn) in the next
iteration. If we recorded any CC0-related
information for this insn, remember it. */
if (insn != BB_END (bb))
{
prev_insn_cc0 = this_insn_cc0;
prev_insn_cc0_mode = this_insn_cc0_mode;
}
} }
#endif #endif
} }
...@@ -6713,7 +6715,7 @@ set_live_p (rtx set, rtx insn ATTRIBUTE_UNUSED, /* Only used with HAVE_cc0. */ ...@@ -6713,7 +6715,7 @@ set_live_p (rtx set, rtx insn ATTRIBUTE_UNUSED, /* Only used with HAVE_cc0. */
#ifdef HAVE_cc0 #ifdef HAVE_cc0
else if (GET_CODE (SET_DEST (set)) == CC0 else if (GET_CODE (SET_DEST (set)) == CC0
&& !side_effects_p (SET_SRC (set)) && !side_effects_p (SET_SRC (set))
&& ((tem = next_nonnote_insn (insn)) == 0 && ((tem = next_nonnote_nondebug_insn (insn)) == NULL_RTX
|| !INSN_P (tem) || !INSN_P (tem)
|| !reg_referenced_p (cc0_rtx, PATTERN (tem)))) || !reg_referenced_p (cc0_rtx, PATTERN (tem))))
return false; return false;
......
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