https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212
--- Comment #305 from Kazumoto Kojima <kkojima at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #304)
> 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?
It isn't. When replacing hard reg with match_dup, it compiles our tiny sfunc
test to:
foo:
mov.l r14,@-r15 ! 32 [c=4 l=2] movsi_ie/8
mov r4,r5 ! 23 [c=4 l=2] movsi_ie/1
sts.l pr,@-r15 ! 33 [c=4 l=2] movsi_ie/10
mov.w .L6,r1 ! 34 [c=10 l=2] *movhi/0
mov #0,r7 ! 16 [c=4 l=2] movsi_ie/2
mov.l .L4,r6 ! 29 [c=10 l=2] movsi_ie/0
sub r1,r15 ! 35 [c=4 l=2] *subsi3_internal
mov r15,r14 ! 30 [c=4 l=2] movsi_ie/1
add #4,r14 ! 31 [c=4 l=2] *addsi3_compact_lra/0
jsr @r6 ! 12 [c=1 l=2] block_lump_real_i4/0
mov r14,r4 ! 9 [c=4 l=2] movsi_ie/1
...
.L6:
.short 260
which wrongly assigns r6 to the function address, for example.