mirror of git://gcc.gnu.org/git/gcc.git
combine: distribute_notes again (PR69567, PR64682)
As it happens the patch I did over a year ago for PR64682 isn't quite correct. This is PR69567. This fixes it. PR rtl-optimization/64682 PR rtl-optimization/69567 * combine.c (distribute_notes) <REG_DEAD>: Place the death note before I2 only if the register is both used and set in I2. From-SVN: r233159
This commit is contained in:
parent
618d6c1c4d
commit
171dc40ede
|
|
@ -1,3 +1,10 @@
|
||||||
|
2016-02-04 Segher Boessenkool <segher@kernel.crashing.org>
|
||||||
|
|
||||||
|
PR rtl-optimization/64682
|
||||||
|
PR rtl-optimization/69567
|
||||||
|
* combine.c (distribute_notes) <REG_DEAD>: Place the death note
|
||||||
|
before I2 only if the register is both used and set in I2.
|
||||||
|
|
||||||
2016-02-04 DJ Delorie <dj@redhat.com>
|
2016-02-04 DJ Delorie <dj@redhat.com>
|
||||||
|
|
||||||
* config/msp430/msp430.c (msp430_start_function): Add function type.
|
* config/msp430/msp430.c (msp430_start_function): Add function type.
|
||||||
|
|
|
||||||
|
|
@ -13901,6 +13901,7 @@ distribute_notes (rtx notes, rtx_insn *from_insn, rtx_insn *i3, rtx_insn *i2,
|
||||||
tem_insn = from_insn;
|
tem_insn = from_insn;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
tem_insn = i3;
|
||||||
if (from_insn
|
if (from_insn
|
||||||
&& CALL_P (from_insn)
|
&& CALL_P (from_insn)
|
||||||
&& find_reg_fusage (from_insn, USE, XEXP (note, 0)))
|
&& find_reg_fusage (from_insn, USE, XEXP (note, 0)))
|
||||||
|
|
@ -13909,7 +13910,14 @@ distribute_notes (rtx notes, rtx_insn *from_insn, rtx_insn *i3, rtx_insn *i2,
|
||||||
place = i3;
|
place = i3;
|
||||||
else if (i2 != 0 && next_nonnote_nondebug_insn (i2) == i3
|
else if (i2 != 0 && next_nonnote_nondebug_insn (i2) == i3
|
||||||
&& reg_referenced_p (XEXP (note, 0), PATTERN (i2)))
|
&& reg_referenced_p (XEXP (note, 0), PATTERN (i2)))
|
||||||
place = i2;
|
{
|
||||||
|
place = i2;
|
||||||
|
/* If the new I2 sets the same register that is marked dead
|
||||||
|
in the note, the note now should not be put on I2, as the
|
||||||
|
note refers to a previous incarnation of the reg. */
|
||||||
|
if (reg_set_p (XEXP (note, 0), PATTERN (i2)))
|
||||||
|
tem_insn = i2;
|
||||||
|
}
|
||||||
else if ((rtx_equal_p (XEXP (note, 0), elim_i2)
|
else if ((rtx_equal_p (XEXP (note, 0), elim_i2)
|
||||||
&& !(i2mod
|
&& !(i2mod
|
||||||
&& reg_overlap_mentioned_p (XEXP (note, 0),
|
&& reg_overlap_mentioned_p (XEXP (note, 0),
|
||||||
|
|
@ -13917,12 +13925,6 @@ distribute_notes (rtx notes, rtx_insn *from_insn, rtx_insn *i3, rtx_insn *i2,
|
||||||
|| rtx_equal_p (XEXP (note, 0), elim_i1)
|
|| rtx_equal_p (XEXP (note, 0), elim_i1)
|
||||||
|| rtx_equal_p (XEXP (note, 0), elim_i0))
|
|| rtx_equal_p (XEXP (note, 0), elim_i0))
|
||||||
break;
|
break;
|
||||||
tem_insn = i3;
|
|
||||||
/* If the new I2 sets the same register that is marked dead
|
|
||||||
in the note, the note now should not be put on I2, as the
|
|
||||||
note refers to a previous incarnation of the reg. */
|
|
||||||
if (i2 != 0 && reg_set_p (XEXP (note, 0), PATTERN (i2)))
|
|
||||||
tem_insn = i2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (place == 0)
|
if (place == 0)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue