This is the mail archive of the 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]

Constraints and reload

Dear all,

I was working on simplifying the movdi in my port and I had put :

  [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,o")
        (match_operand:DI 1 "general_operand"      "r,i,o,r"))]

However, due to constraints on the offset that is allowed, I:

- Added the check of the offset in the expand
- Added the check of the offset in the definition of the instruction
- Changed the constraints to:

  [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,R")
        (match_operand:DI 1 "general_operand"      "r,i,R,r"))]

Where R checks if the operand is a memory operand and if the offset is correct.

Once I did that, in one case of my regression tests, I received the error:
asm operand requires impossible reload

However, if I generate what I get in the first version, all the moves
seem to be correct anyway.

My theory is that reload needs the o EVEN IF what it will be trying to
do is illegal and it will figure that out and finally generate the
right thing afterwards.
Thus, why the o is necessary and not the R.

Is this correct?

Jean Christophe Beyler

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