summaryrefslogtreecommitdiff
path: root/gcc/regs.h
diff options
context:
space:
mode:
authormshawcroft <mshawcroft@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-24 11:07:57 +0000
committermshawcroft <mshawcroft@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-24 11:07:57 +0000
commit71e16a8fb126f4b81b1b04eb6e7f5bfcff79b910 (patch)
treed2f0426293ac9bb76b776e8b899cf5ed99edfaf4 /gcc/regs.h
parentcc3f82be0388732a3dd68e893bbcc0b87ba8c1a3 (diff)
downloadgcc-71e16a8fb126f4b81b1b04eb6e7f5bfcff79b910.tar.gz
2012-05-24 Jim MacArthur<jim.macarthur@arm.com>
* recog.c (reg_fits_class_p): Check both regno and regno + offset are hard registers. * regs.h (in_hard_reg_set_p): Assert that regno is a hard register and check end_regno - 1 is a hard register. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187826 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/regs.h')
-rw-r--r--gcc/regs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/regs.h b/gcc/regs.h
index 328b839ffac..d18bf0aa3c1 100644
--- a/gcc/regs.h
+++ b/gcc/regs.h
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "machmode.h"
#include "hard-reg-set.h"
+#include "rtl.h"
#define REG_BYTES(R) mode_size[(int) GET_MODE (R)]
@@ -367,10 +368,16 @@ in_hard_reg_set_p (const HARD_REG_SET regs, enum machine_mode mode,
{
unsigned int end_regno;
+ gcc_assert (HARD_REGISTER_NUM_P (regno));
+
if (!TEST_HARD_REG_BIT (regs, regno))
return false;
end_regno = end_hard_regno (mode, regno);
+
+ if (!HARD_REGISTER_NUM_P (end_regno - 1))
+ return false;
+
while (++regno < end_regno)
if (!TEST_HARD_REG_BIT (regs, regno))
return false;