https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212
--- Comment #304 from Oleg Endo <olegendo at gcc dot gnu.org> --- (In reply to Kazumoto Kojima from comment #302) > > Yes, that's what I suppose. If the operands of that pattern match with > another registers, the instruction with the operands[2-4] other than r4-r6 > would be recognizable. > I'm not sure if my memory is correct, but such rewriting was attempted and > succeeded at the RA or post reload stage. > Another way would be to define a predicate sfunc_arg[012]_reg which matches > r[456] only and use it in match_operand to avoid unexpected matching. > > (define_insn "block_lump_real_i4" > [(set (mem:BLK (match_operand:SI 2 "sfunc_arg0_reg" "=r,r")) > (mem:BLK (match_operand:SI 3 "sfunc_arg1_reg" "=r,r"))) > (use (match_operand:SI 0 "arith_reg_operand" "r,r")) > (use (match_operand 1 "" "Z,Ccl")) > (use (match_operand:SI 4 "sfunc_arg2_reg" "=r,r")) > ... > (clobber (reg:SI R3_REG))] > "TARGET_HARD_SH4" > ... > > It also worked for me. I think this is a bit clearer, thanks! One more question .... (define_insn "block_lump_real" [(set (mem:BLK (match_operand:SI 2 "sfunc_arg0_reg" "=r,r")) (mem:BLK (match_operand:SI 3 "sfunc_arg1_reg" "=r,r"))) (use (match_operand:SI 0 "arith_reg_operand" "r,r")) (use (match_operand 1 "" "Z,Ccl")) (use (match_operand:SI 4 "sfunc_arg2_reg" "=r,r")) (use (reg:SI R4_REG)) <<<<<< (use (reg:SI R5_REG)) <<<<<< (use (reg:SI R6_REG)) <<<<<< (clobber (match_dup 2)) (clobber (match_dup 3)) (clobber (match_dup 4)) (clobber (reg:SI PR_REG)) Is it possible to do '(use (match_dup 2)' and so on instead of having the hard regs in there?