combine.c (try_combine): Adjust comment.

* combine.c (try_combine): Adjust comment.  Do not add the set of
	insn #0 if the destination indirectly is set or dies in insn #2.
	Tidy up code to distribute a new note.

From-SVN: r197002
This commit is contained in:
Eric Botcazou 2013-03-23 11:06:21 +00:00 committed by Eric Botcazou
parent 956d29dff6
commit 4f25c8fbfd
2 changed files with 17 additions and 12 deletions

View File

@ -1,3 +1,9 @@
2013-03-23 Eric Botcazou <ebotcazou@adacore.com>
* combine.c (try_combine): Adjust comment. Do not add the set of
insn #0 if the destination indirectly is set or dies in insn #2.
Tidy up code to distribute a new note.
2013-03-22 Uros Bizjak <ubizjak@gmail.com> 2013-03-22 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (*movdi_internal): Set prefix_rex attribute * config/i386/i386.md (*movdi_internal): Set prefix_rex attribute

View File

@ -2845,13 +2845,13 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p,
/* See if the SETs in I1 or I2 need to be kept around in the merged /* See if the SETs in I1 or I2 need to be kept around in the merged
instruction: whenever the value set there is still needed past I3. instruction: whenever the value set there is still needed past I3.
For the SETs in I2, this is easy: we see if I2DEST dies or is set in I3. For the SET in I2, this is easy: we see if I2DEST dies or is set in I3.
For the SET in I1, we have two cases: If I1 and I2 independently For the SET in I1, we have two cases: if I1 and I2 independently feed
feed into I3, the set in I1 needs to be kept around if I1DEST dies into I3, the set in I1 needs to be kept around unless I1DEST dies
or is set in I3. Otherwise (if I1 feeds I2 which feeds I3), the set or is set in I3. Otherwise (if I1 feeds I2 which feeds I3), the set
in I1 needs to be kept around unless I1DEST dies or is set in either in I1 needs to be kept around unless I1DEST dies or is set in either
I2 or I3. The same consideration applies to I0. */ I2 or I3. The same considerations apply to I0. */
added_sets_2 = !dead_or_set_p (i3, i2dest); added_sets_2 = !dead_or_set_p (i3, i2dest);
@ -2863,8 +2863,9 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p,
if (i0) if (i0)
added_sets_0 = !(dead_or_set_p (i3, i0dest) added_sets_0 = !(dead_or_set_p (i3, i0dest)
|| (i0_feeds_i2_n && dead_or_set_p (i2, i0dest)) || (i0_feeds_i1_n && dead_or_set_p (i1, i0dest))
|| (i0_feeds_i1_n && dead_or_set_p (i1, i0dest))); || ((i0_feeds_i2_n || (i0_feeds_i1_n && i1_feeds_i2_n))
&& dead_or_set_p (i2, i0dest)));
else else
added_sets_0 = 0; added_sets_0 = 0;
@ -4158,14 +4159,12 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p,
if (i3dest_killed) if (i3dest_killed)
{ {
rtx new_note = alloc_reg_note (REG_DEAD, i3dest_killed, NULL_RTX);
if (newi2pat && reg_set_p (i3dest_killed, newi2pat)) if (newi2pat && reg_set_p (i3dest_killed, newi2pat))
distribute_notes (alloc_reg_note (REG_DEAD, i3dest_killed, distribute_notes (new_note, NULL_RTX, i2, NULL_RTX, elim_i2,
NULL_RTX), elim_i1, elim_i0);
NULL_RTX, i2, NULL_RTX, elim_i2, elim_i1, elim_i0);
else else
distribute_notes (alloc_reg_note (REG_DEAD, i3dest_killed, distribute_notes (new_note, NULL_RTX, i3, newi2pat ? i2 : NULL_RTX,
NULL_RTX),
NULL_RTX, i3, newi2pat ? i2 : NULL_RTX,
elim_i2, elim_i1, elim_i0); elim_i2, elim_i1, elim_i0);
} }