From e7bcc691204350945d31fcb27b6d421cdf6d8453 Mon Sep 17 00:00:00 2001 From: Jim MacArthur Date: Thu, 24 May 2012 11:07:57 +0000 Subject: recog.c (reg_fits_class_p): Check both regno and regno + offset are hard registers. 2012-05-24 Jim MacArthur * 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. From-SVN: r187826 --- gcc/recog.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gcc/recog.c') diff --git a/gcc/recog.c b/gcc/recog.c index c5725d2..d664594 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -2792,14 +2792,16 @@ bool reg_fits_class_p (const_rtx operand, reg_class_t cl, int offset, enum machine_mode mode) { - int regno = REGNO (operand); + unsigned int regno = REGNO (operand); if (cl == NO_REGS) return false; + /* Regno must not be a pseudo register. Offset may be negative. */ return (HARD_REGISTER_NUM_P (regno) - && in_hard_reg_set_p (reg_class_contents[(int) cl], - mode, regno + offset)); + && HARD_REGISTER_NUM_P (regno + offset) + && in_hard_reg_set_p (reg_class_contents[(int) cl], mode, + regno + offset)); } /* Split single instruction. Helper function for split_all_insns and -- cgit v1.1