This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: reload vs adds with clobbers


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]