This is the mail archive of the gcc-patches@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: HARD_REGNO_MODE_OK vs the register allocator


> Lemme get this straight:  You *could* have an SImode value in $r7/$r8
> if the constraint were GENERAL_REGS, but not if it were EIGHT_REGS?

Moves to/from memory can only be done with $r0..$r7 (there are 16
general registers, $r0..$r15, 16 bits each).  So to do an SI reg-mem
move, you pick any register pair in $r0..$r7, then split it into two
HI moves.  So the constraints for movsi must be such that $r0..$r6 are
chosen, yeilding pairs r0/r1 through r6/r7, for reg-mem moves.  For
reg-reg moves, any pair is valid.

The problem is that the constraint is 'e' for EIGHT_REGS ($r0..$r7),
and reload occasionally chooses $r7.  It's in EIGHT_REGS and
HARD_REGNO_MODE_OK says you can put an SI in it (which is true, except
for reg-mem moves) but when split you end up with (mov:hi $r8 (mem))
which isn't legal.


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