re PR rtl-optimization/60116 (wrong code at -Os on x86_64-linux-gnu in 32-bit mode)

PR rtl-optimization/60116
	* combine.c (try_combine): Also remove dangling REG_DEAD notes on the
	other_insn once the combination has been validated.

From-SVN: r207713
This commit is contained in:
Eric Botcazou 2014-02-12 08:49:55 +00:00 committed by Eric Botcazou
parent 6cfbc02310
commit 62b0355332
4 changed files with 52 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2014-02-12 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/60116
* combine.c (try_combine): Also remove dangling REG_DEAD notes on the
other_insn once the combination has been validated.
2014-02-11 Jan Hubicka <hubicka@ucw.cz>
PR lto/59468

View File

@ -3894,14 +3894,15 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p,
PATTERN (undobuf.other_insn) = other_pat;
/* If any of the notes in OTHER_INSN were REG_UNUSED, ensure that they
are still valid. Then add any non-duplicate notes added by
recog_for_combine. */
/* If any of the notes in OTHER_INSN were REG_DEAD or REG_UNUSED,
ensure that they are still valid. Then add any non-duplicate
notes added by recog_for_combine. */
for (note = REG_NOTES (undobuf.other_insn); note; note = next)
{
next = XEXP (note, 1);
if (REG_NOTE_KIND (note) == REG_UNUSED
if ((REG_NOTE_KIND (note) == REG_DEAD
|| REG_NOTE_KIND (note) == REG_UNUSED)
&& ! reg_set_p (XEXP (note, 0), PATTERN (undobuf.other_insn)))
remove_note (undobuf.other_insn, note);
}

View File

@ -1,3 +1,7 @@
2014-02-12 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/execute/20140212-1.c: New test.
2014-02-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60047

View File

@ -0,0 +1,37 @@
/* PR rtl-optimization/60116 */
/* Reported by Zhendong Su <su@cs.ucdavis.edu> */
extern void abort (void);
int a, b, c, d = 1, e, f = 1, h, i, k;
char g, j;
void
fn1 (void)
{
int l;
e = 0;
c = 0;
for (;;)
{
k = a && b;
j = k * 54;
g = j * 147;
l = ~g + (long long) e && 1;
if (d)
c = l;
else
h = i = l * 9UL;
if (f)
return;
}
}
int
main (void)
{
fn1 ();
if (c != 1)
abort ();
return 0;
}