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: Question about Machine Description


Ian Lance Taylor <ian@airs.com> writes:
> This kind of error generally means that the operand predicate accepts
> an operand which no constraint matches.  If the predicate (e.g.,
> register_operand) accepts an operand, then there must be a constraint
> that matches it.  Otherwise you will get an error in
> constrain_operands, such as the above.

and later:

> When I said this:
>
>> > This kind of error generally means that the operand predicate accepts
>> > an operand which no constraint matches.  If the predicate (e.g.,
>> > register_operand) accepts an operand, then there must be a constraint
>> > that matches it.  Otherwise you will get an error in
>> > constrain_operands, such as the above.
>
> I mean that, in the instruction above, any operand which matches
> nonimmediate_operand must be matched by at least one of the
> constraints 'm' or 'r', and any operand which matches const0_operand
> must match the constraint 'n'.

This might confuse people.  It sounds your first quote is saying that
everything accepted by a predicate must also match at least one
constraint, and of course that isn't true.  E.g. register_operand
accepts registers from any class, whereas 'r' only matches GENERAL_REGS.
And it's usually OK (but not good practice, because it generates poor
code) for a nonimmediate_operand to only provide 'r' constraints.
More realistically, it's OK for a nonimmediate_operand to only allow
memory constraints for some combinations of operands.  It's reload's
job to fix this sort thing.

I realise I'm not telling you (Ian) anything new here, I just
thought it was worth clarifying.

Richard


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