Le 02/05/2012 16:41, Ian Lance Taylor a écrit : > Aurelien Buhrig <aurelien.buhrig....@gmail.com> writes: > >> I have an issue (gcc 4.6.3, private bacakend) when reloading operands of >> this insn: >> (set (subreg:SI (reg:QI 21 [ iftmp.1 ]) 0) >> (lshiftrt:SI (reg/v:SI 24 [ w ]) (const_int 31 [0x1f])) >> >> The register 21 is reloaded into >> (reg:QI 0 r0 [orig:21 iftmp.1 ] [21]), which is a HI-wide hw register. >> Since it is a BIG_ENDIAN target, the SI subreg regno is then -1. >> >> Note that word_mode is SImode, whereas the class r0 belongs to is >> HI-wide. I don't know if this matters when reloading. >> >> I have no idea how to debug this, if it is a backend or a reload bug. >> Any idea? > > Where did that insn come from? It looks like it really wants to be > > (set (reg:QI 21) > (truncate:QI (lshiftrt:SI (reg:SI 24) (const_int 31)))) >
It comes from the combine pass, which merged the following insns: (insn 20 19 21 5 (set (reg:SI 27) (lshiftrt:SI (reg/v:SI 24 [w]) (const_int 31 [0x1f]))) {*lshrsi3_split} (nil)) (insn 21 20 22 5 (set (reg:QI 21 [ iftmp.1 ]) (subreg:QI (reg:SI 27) 3)) {movqi} (expr_list:REG_DEAD (reg:SI 27) ------ Here is the combiner output: Trying 20 -> 21: Successfully matched this instruction: (set (subreg:SI (reg:QI 21 [ iftmp.1 ]) 0) (lshiftrt:SI (reg/v:SI 24 [ w ]) (const_int 31 [0x1f]))) deferring deletion of insn with uid = 20. modifying insn i3 21 r21:QI#0=r24:SI 0>>0x1f deferring rescan insn with uid = 21. Thanks, Aurélien