Hello Segher,
- However, the predicate "r" in the statement above, does not allow a
subreg.
Yes it does. See register_operand in recog.c for example. It is of
course possible your gpc_reg_operand doesn't allow it (bad idea, but I
don't know your code).
It does not. When I change the description to :
(define_insn "movhi_internal"
[(set (match_operand:HI 0 "movhi_operand_0" "=r,Z,C,r,r,u,u,r,r,r")
(match_operand:HI 1 "movhi_operand_1" "x9,r,r,Z,C,Z,C,O,k,i"))]
with x9 defined as "ext_gpc_reg_operand"
and
(define_predicate "ext_gpc_reg_operand"
(and (match_operand 0 "register_operand")
( ior (match_test "( (GET_CODE(op) == REG && (
(REGNO(op) >= ARG_POINTER_REGNUM && !CA_REGNO_P(REGNO(op)))
|| REGNO(op) == SFP_REGNO
|| REGNO (op) == ARG_POINTER_REGNUM
|| REGNO (op) <= MAX_REGFILE_REGNO)))")
(match_test "( (GET_CODE(op) == SUBREG && SUBREG_BYTE(op) == 0 && (
(REGNO(SUBREG_REG(op)) >= ARG_POINTER_REGNUM && !CA_REGNO_P(REGNO(SUBREG_REG(op))))
|| REGNO(SUBREG_REG(op)) == SFP_REGNO
|| REGNO (SUBREG_REG(op)) == ARG_POINTER_REGNUM
|| REGNO (SUBREG_REG(op)) <= MAX_REGFILE_REGNO)))"))))
Then, its gone. It now crashes on other "r"'s in the same instruction,
as it apparently
wants to move this operand on the stack, and for that it needs the "x9"
also in other places.
It is of course possible something is wrong in my description, but the
"r" does not seem to allow the
subreg. At least not in my port.
I will try putting more "x9"'s tomorrow.
Best Regards,
Henri.