> On Oct 3, 2019, at 9:12 AM, Richard Earnshaw (lists) 
> <richard.earns...@arm.com> wrote:
> 
> On 03/10/2019 10:48, Segher Boessenkool wrote:
>>> ...
>> But ALL_REGS should contain *all* registers.  The union of any two register
>> classes has to be contained in some register class, so every register class
>> has to be contained in ALL_REGS.
>> Segher
> 
> Why would anyone want a to form a union of one class with a class that can't 
> be used for allocation.  That's just silly.

Yes, if that's the only purpose of register classes.

If the documentation doesn't match what the real intent is, and some developers 
apparently use the intent while others use the documentation.  The result is 
bugs like the one we're talking about here.  

It may well make sense to say that ALL_REGS should be the set of all 
*allocatable* registers.  If that's what we want, the documentation should say 
so, and then the code has to understand that some registers (like CC_REG) may 
be outside ALL_REGS.  Similarly, NO_REGS is currently documented as "no 
registers" (empty set).  If it is intended that it might contain 
non-allocatable registers, again the documentation should say so.

        paul

Reply via email to