From 519164a9ede028adf015270894441fb30433d969 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Mon, 5 Aug 1996 14:27:22 -0700 Subject: [PATCH] (arith_reg_operand): Reject SUBREG of an invalid hard reg. From-SVN: r12594 --- gcc/config/sh/sh.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 6b8cc724a99..834e60bf382 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -2198,13 +2198,17 @@ arith_reg_operand (op, mode) { if (register_operand (op, mode)) { + int regno; + if (GET_CODE (op) == REG) - return (REGNO (op) != T_REG - && REGNO (op) != PR_REG - && REGNO (op) != FPUL_REG - && REGNO (op) != MACH_REG - && REGNO (op) != MACL_REG); - return 1; + regno = REGNO (op); + else if (GET_CODE (op) == SUBREG && GET_CODE (SUBREG_REG (op)) == REG) + regno = REGNO (SUBREG_REG (op)); + else + return 1; + + return (regno != T_REG && regno != PR_REG && regno != FPUL_REG + && regno != MACH_REG && regno != MACL_REG); } return 0; } -- 2.30.2