This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: preprocess_constraints, reg-stack.c and register classes


On Mon, Mar 10, 2003 at 09:24:09PM +0100, Michael Matz wrote:
> Hi,
> 
> On Mon, 10 Mar 2003, Christian Ehrhardt wrote:
> 
> > preprocess_constraints calculates (among other things) the
> > register class of each operand in each alternative. However,
> > if an operand's constraint is just a number (i.e. it must match
> > another operand) the register class is uninitialized (NO_REGS).
> 
> NO_REGS is not uninitialized.  If one is really interested in the class
> for a matching constraint depends on the actual use case.  After all, a
> matching constraint has not only a class of possible objects, but instead
> it must be equal to another operand.  So for some uses it arguably is
> wrong to let it have a class.

These uses could still check .matches and ignore .class if it is non negative.

> > * regrename.c calculates the proper register class before looking at
> >   the class field.
> >
> > My question is: Wouldn't it be a good idea if preprocess_constraints
> > would calculate the proper regclass?
> 
> Hmm, maybe.  Users interested if it's a matching constraint anyway need to
> use the "matches" member and can't rely on the "class" member being
> NO_REGS, as that can also stand for really no regs ;-)
> 
> Do you see an actual failure somewhere, or do you just want to clean it up
> (which might be worthwhile in itself)?

No, I don't see a specific failure. Basically what I'm trying to
do is to get rid of the non const uses of recog_op_alt outside of
preprocess_constraings. And the only such use is .matched in _regrename.c_.
This could be done by a function/macro or by filling in the proper value
in preprocess_constraints. The latter is what I'm trying to do.

   regards  Christian

-- 
THAT'S ALL FOLKS!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]