diff options
author | Jeff Law <law@redhat.com> | 2016-11-29 21:15:55 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2016-11-29 21:15:55 -0700 |
commit | 48855443fa042c0c009db313db1dd16a355ae986 (patch) | |
tree | bd147bf9d5c008fb283d25fa4cff49219c743a1d /gcc/lra-constraints.c | |
parent | fbe9724cc368a76c8bb04c822a9877b9096758e6 (diff) | |
download | gcc-48855443fa042c0c009db313db1dd16a355ae986.zip gcc-48855443fa042c0c009db313db1dd16a355ae986.tar.gz gcc-48855443fa042c0c009db313db1dd16a355ae986.tar.bz2 |
lra-constraints.c (check_and_process_move): Constrain the range of DCLASS and SCLASS to avoid false positive out of bounds...
* lra-constraints.c (check_and_process_move): Constrain the
range of DCLASS and SCLASS to avoid false positive out of bounds
array index warning.
From-SVN: r242993
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r-- | gcc/lra-constraints.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 133b55c..7784ad2 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; |