This is the mail archive of the
mailing list for the GCC project.
Re: Register allocation trouble
- From: Andrew Stubbs <andrew_stubbs at mentor dot com>
- To: <gcc at gcc dot gnu dot org>
- Date: Mon, 24 Jul 2017 12:38:04 +0100
- Subject: Re: Register allocation trouble
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org>
Thanks to all those who replied. :-)
Here's what I've done to fix the problem:
1. Set the base rclass to A only.
2. Configured secondary reloads to B via A.
3. Disabled the Rb constraint. [*]
That's enough to create correct code, but it's pretty horrible, so I
also added new patterns of the form Nathan suggested so that the base
register can be allocated directly, as an optimization. These occur
before the main mov insn in the search order, and catch only valid MEMs
that won't get meddled with, so I believe that the "one mov per mode"
rule can be safely ignored. The main mov pattern can still do the
loads/stores, via the secondary reloads, so I believe that to be safe too.
[*] I've not removed it because actually it's still active for some
address spaces, but that's a detail I glossed over previously.