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: Controlling instruction alternative selection


On 07/30/2015 09:54 PM, Paul Shortis wrote:
> Resulting in ...
> error: unable to find a register to spill in class âGP_REGSâ
> 
> enabling lra and inspecting the rtl dump indicates that both
> alternatives (R and r) seem to be equally appealing to the allocater so
> it chooses 'R' and fails.

The problem isn't in lra, it is in reload.  You want lra to use the
three address instruction, but you then want reload to use the two
address alternative.

> Using constraint disparaging (?R) eradicates the errors, but of course
> that causes the 'R' three address alternative to never be used.

You want to disparage the three address alternative in reload, but not
in lra.  There is a special code for that, you can use ^ instead of ? to
make that happen.  That may or may not help though.

There is also a hook TARGET_CLASS_LIKELY_SPILLED_P which might help.
You should try defining this to return true for the 'R' class if it
doesn't already.

Jim


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