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.
Thanks again
Andrew
[*] I've not removed it because actually it's still active for some
address spaces, but that's a detail I glossed over previously.