From: Hariharan Sandanagobalane Date: Thu, 12 May 2011 11:12:12 +0000 (+0000) Subject: ira.c (clarify_prohibited_class_mode_regs): Prevent the function from accessing beyon... X-Git-Tag: releases/gcc-4.7.0~6801 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b27981e06b8ae5972ea24ca63e9d07f5453aa234;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8dcd8b95fd86..4bb674995f7a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-05-12 Hariharan Sandanagobalane + + * 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. + 2011-05-12 DJ Delorie (rx_builtins): New arrays - holds builtin functions. diff --git a/gcc/ira.c b/gcc/ira.c index 32dfa18ce198..9235cb3f94ba 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