This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Controlling what kind of value ends in a register
- From: Alexandre Courbot <Alexandre dot Courbot at lifl dot fr>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 16 Sep 2003 18:11:02 +0200
- Subject: Controlling what kind of value ends in a register
Hello everybody,
My machine definition requires that one kind of register class (named
POINTER_REGS) is exclusively used to hold addresses. In other words, whenever
an address must be stored into a register, this class must be used. In no way
should an address finish in a register that doesn't belong to this class.
My problem is that I don't know how to direct the register allocator to select
the correct register class. Using reloading doesn't help here, as the value
will eventually be copied into the register chosen by the allocator (of wrong
class) after being copied in a register of the right class. I had a look at
regclass.c and couldn't find anything else but costs to direct the allocator.
Costs are unfortunately only a direction and not a requirement.
Is there a way to direct the register allocator to chose a certain class of
registers (that doesn't belong to GENERAL_REGISTERS) from what's being copied
into that reg? I'd bet there is and it is quite obvious, but so far I missed
it. Any pointer would be greatly appreciated.
Thanks,
Alex.