Prevent out-of-bounds array access in reload.

PR rtl-optimization/18877
* reload.c (decompose) <case REG, case SUBREG>: Handle pseudo reg
number in val.start.

From-SVN: r98938
This commit is contained in:
Martin Koegler 2005-04-28 22:36:56 +02:00 committed by Jim Wilson
parent b1079a6189
commit 67468e8eda
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2005-04-28 Martin Koegler <mkoegler@auto.tuwien.ac.at>
PR rtl-optimization/18877
* reload.c (decompose) <case REG, case SUBREG>: Handle pseudo reg
number in val.start.
2005-04-28 David Edelsohn <edelsohn@gnu.org>
PR target/20813

View File

@ -2389,7 +2389,7 @@ decompose (rtx x)
case REG:
val.reg_flag = 1;
val.start = true_regnum (x);
if (val.start < 0)
if (val.start < 0 || val.start >= FIRST_PSEUDO_REGISTER)
{
/* A pseudo with no hard reg. */
val.start = REGNO (x);
@ -2406,7 +2406,7 @@ decompose (rtx x)
return decompose (SUBREG_REG (x));
val.reg_flag = 1;
val.start = true_regnum (x);
if (val.start < 0)
if (val.start < 0 || val.start >= FIRST_PSEUDO_REGISTER)
return decompose (SUBREG_REG (x));
else
/* A hard reg. */