From: Martin Koegler Date: Thu, 28 Apr 2005 20:36:56 +0000 (+0200) Subject: Prevent out-of-bounds array access in reload. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=67468e8eda640eb0cd6c64186533ad412137512f;p=gcc.git Prevent out-of-bounds array access in reload. PR rtl-optimization/18877 * reload.c (decompose) : Handle pseudo reg number in val.start. From-SVN: r98938 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4ce81e094bf..15f1932b320 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-04-28 Martin Koegler + + PR rtl-optimization/18877 + * reload.c (decompose) : Handle pseudo reg + number in val.start. + 2005-04-28 David Edelsohn PR target/20813 diff --git a/gcc/reload.c b/gcc/reload.c index 394a43014b6..9f10321d9c6 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -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. */