reload vs adds with clobbers
Jim Wilson
wilson@tuliptree.org
Fri Jun 6 05:31:00 GMT 2003
DJ Delorie wrote:
> However, inc/dec cannot accept a constant of zero, which is the case
> that fails - adding zero to a register.
Curious that reload is trying to emit an add of zero. It probably
shouldn't be doing that. It might be useful to try to fix this if it is
easy, however, reload changes are rarely easy, so it might not be worth
the trouble.
reload_cse should fix this I think, but reload_cse is only run when
optimizing, so you will have to handle this insturction when not optimizing.
> I'm currently testing adding an !N constraint after the O,P ones, to
> catch the zero case, with an output template of ";", assuming that gcc
> will always choose the P constraint for non-zero cases.
That should work, but it would be better to define a new constraint
letter to match only zero. And of course you need to document why this
wierdness is there in the pattern.
> We could use "#" as the output template, and define a splitter that
> turns it into nothing.
Sounds reasonable.
Jim
More information about the Gcc
mailing list