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

--- Comment #5 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #4)
> Started with r9-3950-g2f0b80c7a4ab4254f57ba63de26ebb7896e3742d
> Does the modsw instruction really need the early-clobber (i.e. does it first
> overwrite the result register before reading the input registers)?

No.  And I have a patch, but testing showed some (perhaps unrelated) problems
so it is delayed.

> Though, even if it doesn't and this particular issue would be fixed by
> dropping it, there can be other instructions that really do need the
> early-clobber.

The peephole won't match if an input and output reg are identical, that is
all.  But the peephole very often does not match anyway.

So (in addition to removing the earlyclobber) I did a define_insn_and_split
instead of the peephole.  That is much more reliable.

> Before the r9-3950 change, gcc would silently reload the input from r20 to
> some other register to honor the early-clobber.
> If that is a behavior that is fine for insns other than inline-asm, perhaps
> the
> r9-3950 changes should be done only when reloading inline-asm and nothing
> else?

The LRA change is correct AFAICS.  But combine makes a change that violates
the earlyclobber...  I need to do something about that, too.

Reply via email to