https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212

--- Comment #393 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Kazumoto Kojima from comment #392)
> Created attachment 59309 [details]
> a patch to fix pr55212-c384.C on devel/sh-lra

Thanks so much for looking into it.

Yes, insn matching order is important, there are some other cases already in
sh.md where insn order is important.

Adding a 
   !hard_reg_r0 (operands[1], SImode) 

while the operand itself is like
   (match_operand:SI 1 "arith_reg_operand" "^zr")

... looks a bit confusing, I think.  The constraint would allow R0 via "z", but
the    "!hard_reg_r0 (operands[1], SImode)" would inhibit the pattern.

So for now I've opted to simply reorder the insn patterns on devel/sh-lra and
added a comment.  Confirmed that pr55212-c384.C is fixed by that.

Reply via email to