This is the mail archive of the
mailing list for the GCC project.
Re: mov arguments are the same
"Paulo J. Matos" <firstname.lastname@example.org> writes:
> In a rule like
> (set (match_operand 0 ...)
> (match_operand 1 ...))
> I sometimes have operand0 equal to operand1, as in
> rtx_equal_p(operand, operand) == 1.
> This generates a move between the same location (same as a nop).
> Is there a reason for getting this and is it up to me to handle it or
> this is just the result of some problem with my md file? I am in
Moves between the same register are normally eliminated by a loop at the
end of reload(). Does your processor support memory-to-memory moves? I
don't think anything will explicitly eliminate those, though I'm also
not sure why they would be created in the first place.
I'm surprised that it happens, but I don't know what would cause it. In
particular I don't know that it is a problem in your MD file. You'll
have to find out where they are coming from.