Hello All,
Sorry, I found it myself.
> 583: r990:SI=zero_extend(r378:SI#0)
- The statement (r378:SI#0) takes the '0' subreg form reg r378:SI.
(shorthand in the reload dump.)
> (define_insn "zero_extendhisi2_internal"
> [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r")
> (zero_extend:SI (match_operand:HI 1 "movhi_operand_0" "Z,C,r")))]
- However, the predicate "r" in the statement above, does not allow a
subreg.
- So, I defined another predicate, that allows the subreg, and then it's
gone.
Best Regards,
Henri
On 11/3/20 2:00 PM, Henri Cloetens wrote:
Hello All,
I am working on a custom front-end, ran in an issue with reload. (step
277).
The GCC version is 9.2.0
a. After expand, (step 234), I get:
(insn 228 227 229 15 (set (reg:SI 186 [ x__lsm.224 ])
(zero_extend:SI (subreg:HI (reg:SI 378) 0)))
"/home/henri/blueICe/gcc/newlib/newlib/libc/stdlib/ldtoa.c":784:5 43
{zero_extendhisi2_internal}
(nil))
b. The machine does have the instruction to do this.
(zero_extendhisi2_internal). Here is the pattern description:
(define_insn "zero_extendhisi2_internal"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r")
(zero_extend:SI (match_operand:HI 1 "movhi_operand_0" "Z,C,r")))]
c. Then the whole code runs through reload, and there it somewhere
goes wrong.
The reloader changes the target register, and the operation gets
distorted.
The subregging operation is gone !!.
583: r990:SI=zero_extend(r378:SI#0)
d. This then leads further to error. The reloader restructures:
583: r990:SI=zero_extend(r1056:HI)
Inserting slow/invalid mem reload before:
1381: r1055:SI=[sfp:SI+0x2c]
1382: r1056:HI=r1055:SI#0
but the last operation (1382) is impossible. The reloader gets in an
infinite loop, and crashes on
max. number of reloads reached.
Now, yes, obviously, I made a mistake .. But where to look ?. What did
I do wrong the subreg got lost ?.
Best Regards,
Henri.