aboutsummaryrefslogtreecommitdiff
path: root/gcc/ira.c
diff options
context:
space:
mode:
authorHariharan Sandanagobalane <hariharan@picochip.com>2011-05-12 11:12:12 +0000
committerHariharan Sandanagobalane <hariharans@gcc.gnu.org>2011-05-12 11:12:12 +0000
commitb27981e06b8ae5972ea24ca63e9d07f5453aa234 (patch)
tree9773afe85f51a652a50d966f4cacc84c1cc2311f /gcc/ira.c
parentf3b143f080d17738cb9888a6d3880f1fb26bf8d7 (diff)
downloadgcc-b27981e06b8ae5972ea24ca63e9d07f5453aa234.zip
gcc-b27981e06b8ae5972ea24ca63e9d07f5453aa234.tar.gz
gcc-b27981e06b8ae5972ea24ca63e9d07f5453aa234.tar.bz2
ira.c (clarify_prohibited_class_mode_regs): Prevent the function from accessing beyond the end of REGNO_REG_CLASS array by...
* ira.c (clarify_prohibited_class_mode_regs): Prevent the function from accessing beyond the end of REGNO_REG_CLASS array by stopping the loop early. From-SVN: r173699
Diffstat (limited to 'gcc/ira.c')
-rw-r--r--gcc/ira.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ira.c b/gcc/ira.c
index 32dfa18..9235cb3 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -1422,6 +1422,12 @@ clarify_prohibited_class_mode_regs (void)
if (TEST_HARD_REG_BIT (ira_prohibited_class_mode_regs[cl][j], hard_regno))
continue;
nregs = hard_regno_nregs[hard_regno][j];
+ if (hard_regno + nregs > FIRST_PSEUDO_REGISTER)
+ {
+ SET_HARD_REG_BIT (ira_prohibited_class_mode_regs[cl][j],
+ hard_regno);
+ continue;
+ }
pclass = ira_pressure_class_translate[REGNO_REG_CLASS (hard_regno)];
for (nregs-- ;nregs >= 0; nregs--)
if (((enum reg_class) pclass