This is the mail archive of the
mailing list for the GCC project.
Re: Controlling instruction alternative selection
- From: Jim Wilson <jim dot wilson at linaro dot org>
- To: Paul Shortis <pshortis at dataworx dot com dot au>, gcc at gcc dot gnu dot org
- Date: Mon, 03 Aug 2015 13:00:39 -0700
- Subject: Re: Controlling instruction alternative selection
- Authentication-results: sourceware.org; auth=none
- References: <cb805a481c20ec3ab641d413da4efede at dataworx dot com dot au>
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
> 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