Problem with movqi pattern

Petar Penchev ptr@melexis.com
Thu Jun 10 08:29:00 GMT 2004


Hello All,
The target I'm porting GCC to has some registers that do not support  
QImode. I have define HARD_REGNO_MODE_OK  and REGISTER_MOVE_COST to return  
appropriaye values. However GCC generates RTL for movqi into a register  
that does not support it. I have not put any constraints for that register  
in movqi. GCC internals says :

"......
If reload sees an insn consisting of a single set between two hard  
registers, and if
REGISTER_MOVE_COST applied to their classes returns a value of 2, reload  
does not
check to ensure that the constraints of the insn are met. Setting a cost  
of other than
2 will allow reload to verify that the constraints are met. You should do  
this if the
`movm' pattern's constraints do not allow such copying.
...."

REGISTER returns greater that 2 value for QImode. But I've got error  
message that instruction does not satisfy its containts and following RTL  
dump from GCC

(insn 317 316 83 2 ../../gcc_src/gcc/unwind-dw2-fde.c:785
    (set (reg:QI 2 X)
         (mem/s:QI (reg:HI 1 Y) [31 S1 A16])) 23 {*movqi} (nil)
     (nil))

My problem is that this instruction must not be generated by GCC becaues X  
register does not support QImode.

Do I have to define some additional macros to say to GCC that X register  
is unavailible in QImode ?

--
Regards
Petar Penchev



More information about the Gcc mailing list