Dummy questions on GCC internals

Ulrich Weigand weigand@immd1.informatik.uni-erlangen.de
Wed May 21 23:16:00 GMT 2003


DJ Delorie wrote:

>The important thing to realize is that the predicate determines what
>types of operands gcc will give to this insn, and the constraints do
>*not*.  Thus, it is critically important that every type of operand
>that the predicate allows be able to match at least one of the
>constraints, or at least that the predicate reject any operand that
>won't match any of the constraints.

Actually, as long as reload knows how to fix the insn up, the 
predicate may certainly accept operands that do not literally 
match any constraint.  In particular, reload knows how to load
an operand from memory into a register, and hence a combination
of a "nonimmediate_operand" predicate with an "r" constraint is
perfectly valid (even though it may or may not be more efficient
overall to use "register_operand" in that case).

In particular, in the original poster's case of 

(insn/f 55 54 56 0x0 (set (reg/f:HI 8 ix)
        (plus:HI (reg/f:HI 8 ix)
            (reg/f:HI 10 sp))) 8 {addhi3} (nil)
    (nil))

the operands *are* all in registers.  If this still doesn't match
the constraints, I can only assume that something is weird with
the register classes here (are those hard regs all in the class
GENERAL_REGS?).

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de



More information about the Gcc mailing list