From: Nick Clifton Date: Wed, 27 Apr 2011 09:06:24 +0000 (+0000) Subject: mcore.h (REGNO_REG_CLASS): Do not index beyond the end of the regno_reg_class array. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e1ea745113840663b7aacd5b1b5abd4ad6f3d0bb;p=gcc.git mcore.h (REGNO_REG_CLASS): Do not index beyond the end of the regno_reg_class array. * config/mcore/mcore.h (REGNO_REG_CLASS): Do not index beyond the end of the regno_reg_class array. From-SVN: r173015 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3a358d9d750..9c06f8be556 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-04-27 Nick Clifton + + * config/mcore/mcore.h (REGNO_REG_CLASS): Do not index beyond the + end of the regno_reg_class array. + 2011-04-27 Jakub Jelinek PR c/48742 diff --git a/gcc/config/mcore/mcore.h b/gcc/config/mcore/mcore.h index 278a8ccf0dc..398dcedfe22 100644 --- a/gcc/config/mcore/mcore.h +++ b/gcc/config/mcore/mcore.h @@ -357,7 +357,7 @@ enum reg_class or could index an array. */ extern const enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER]; -#define REGNO_REG_CLASS(REGNO) regno_reg_class[REGNO] +#define REGNO_REG_CLASS(REGNO) ((REGNO) < FIRST_PSEUDO_REGISTER ? regno_reg_class[REGNO] : NO_REGS) /* When this hook returns true for MODE, the compiler allows registers explicitly used in the rtl to be used as spill registers