From 68e1f2b7bda296af6971cc08309cf7a317638a48 Mon Sep 17 00:00:00 2001 From: law Date: Wed, 30 Nov 2016 04:15:55 +0000 Subject: [PATCH] * lra-constraints.c (check_and_process_move): Constrain the range of DCLASS and SCLASS to avoid false positive out of bounds array index warning. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242993 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/lra-constraints.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b6383aa4691..df787e1be1e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-11-29 Jeff Law + + * lra-constraints.c (check_and_process_move): Constrain the + range of DCLASS and SCLASS to avoid false positive out of bounds + array index warning. + 2016-11-29 David Malcolm * doc/install.texi (--with-target-bdw-gc): Remove stray '@'. diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 133b55ce0ba..7784ad29744 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -1150,6 +1150,7 @@ check_and_process_move (bool *change_p, bool *sec_mem_p ATTRIBUTE_UNUSED) sclass = dclass = NO_REGS; if (REG_P (dreg)) dclass = get_reg_class (REGNO (dreg)); + gcc_assert (dclass < LIM_REG_CLASSES); if (dclass == ALL_REGS) /* ALL_REGS is used for new pseudos created by transformations like reload of SUBREG_REG (see function @@ -1161,6 +1162,7 @@ check_and_process_move (bool *change_p, bool *sec_mem_p ATTRIBUTE_UNUSED) return false; if (REG_P (sreg)) sclass = get_reg_class (REGNO (sreg)); + gcc_assert (sclass < LIM_REG_CLASSES); if (sclass == ALL_REGS) /* See comments above. */ return false; -- 2.11.4.GIT