re PR rtl-optimization/56571 (ICE in copyprop_hardreg_forward_1, at regcprop.c (insn does not satisfy its constraints !))

PR middle-end/56571
	* valtrack.c (cleanup_auto_inc_dec): Unshare clobbers originating
	from pseudos.
	* emit-rtl.c (verify_rtx_sharing): Likewise.
	(copy_insn_1): Likewise.
	* rtl.c (copy_rtx): Likewise.
	PR middle-end/56571
	* gcc.c-torture/compile/pr56571.c: New testcase.

From-SVN: r196612
This commit is contained in:
Jan Hubicka 2013-03-12 13:13:33 +01:00 committed by Jan Hubicka
parent f22e3c85d7
commit c5c5ba89ac
6 changed files with 48 additions and 6 deletions

View File

@ -1,3 +1,12 @@
2013-03-11 Jan Hubicka <jh@suse.cz>
PR middle-end/56571
* valtrack.c (cleanup_auto_inc_dec): Unshare clobbers originating
from pseudos.
* emit-rtl.c (verify_rtx_sharing): Likewise.
(copy_insn_1): Likewise.
* rtl.c (copy_rtx): Likewise.
2013-03-11 Georg-Johann Lay <avr@gjlay.de>
PR target/56591

View File

@ -2580,10 +2580,14 @@ verify_rtx_sharing (rtx orig, rtx insn)
case RETURN:
case SIMPLE_RETURN:
case SCRATCH:
return;
/* SCRATCH must be shared because they represent distinct values. */
return;
case CLOBBER:
if (REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER)
/* Share clobbers of hard registers (like cc0), but do not share pseudo reg
clobbers or clobbers of hard registers that originated as pseudos.
This is needed to allow safe register renaming. */
if (REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER
&& ORIGINAL_REGNO (XEXP (x, 0)) == REGNO (XEXP (x, 0)))
return;
break;
@ -2797,7 +2801,11 @@ repeat:
/* SCRATCH must be shared because they represent distinct values. */
return;
case CLOBBER:
if (REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER)
/* Share clobbers of hard registers (like cc0), but do not share pseudo reg
clobbers or clobbers of hard registers that originated as pseudos.
This is needed to allow safe register renaming. */
if (REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER
&& ORIGINAL_REGNO (XEXP (x, 0)) == REGNO (XEXP (x, 0)))
return;
break;
@ -5303,7 +5311,11 @@ copy_insn_1 (rtx orig)
case SIMPLE_RETURN:
return orig;
case CLOBBER:
if (REG_P (XEXP (orig, 0)) && REGNO (XEXP (orig, 0)) < FIRST_PSEUDO_REGISTER)
/* Share clobbers of hard registers (like cc0), but do not share pseudo reg
clobbers or clobbers of hard registers that originated as pseudos.
This is needed to allow safe register renaming. */
if (REG_P (XEXP (orig, 0)) && REGNO (XEXP (orig, 0)) < FIRST_PSEUDO_REGISTER
&& ORIGINAL_REGNO (XEXP (orig, 0)) == REGNO (XEXP (orig, 0)))
return orig;
break;

View File

@ -256,7 +256,11 @@ copy_rtx (rtx orig)
/* SCRATCH must be shared because they represent distinct values. */
return orig;
case CLOBBER:
if (REG_P (XEXP (orig, 0)) && REGNO (XEXP (orig, 0)) < FIRST_PSEUDO_REGISTER)
/* Share clobbers of hard registers (like cc0), but do not share pseudo reg
clobbers or clobbers of hard registers that originated as pseudos.
This is needed to allow safe register renaming. */
if (REG_P (XEXP (orig, 0)) && REGNO (XEXP (orig, 0)) < FIRST_PSEUDO_REGISTER
&& ORIGINAL_REGNO (XEXP (orig, 0)) == REGNO (XEXP (orig, 0)))
return orig;
break;

View File

@ -1,3 +1,8 @@
2013-03-11 Jan Hubicka <jh@suse.cz>
PR middle-end/56571
* gcc.c-torture/compile/pr56571.c: New testcase.
2013-03-11 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* gcc.dg/tree-ssa/vector-4.c: Add comment regarding xfail.

View File

@ -0,0 +1,8 @@
/* { dg-options "-funroll-loops -ftracer" } */
int a, b;
int f(void)
{
(a % b) && f();
a = (0 || a | (a ? : 1));
}

View File

@ -71,7 +71,11 @@ cleanup_auto_inc_dec (rtx src, enum machine_mode mem_mode ATTRIBUTE_UNUSED)
/* SCRATCH must be shared because they represent distinct values. */
return x;
case CLOBBER:
if (REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER)
/* Share clobbers of hard registers (like cc0), but do not share pseudo reg
clobbers or clobbers of hard registers that originated as pseudos.
This is needed to allow safe register renaming. */
if (REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER
&& ORIGINAL_REGNO (XEXP (x, 0)) == REGNO (XEXP (x, 0)))
return x;
break;