This is the mail archive of the
mailing list for the GCC project.
Re: HARD_REGNO_MODE_OK vs the register allocator
- From: DJ Delorie <dj at redhat dot com>
- To: rth at redhat dot com
- Cc: geoffk at geoffk dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 30 Apr 2003 22:23:19 -0400
- Subject: Re: HARD_REGNO_MODE_OK vs the register allocator
- References: <200304292136.h3TLa8809569@greed.delorie.com> <email@example.com> <200304300401.h3U41L007885@greed.delorie.com> <200304301928.h3UJSjF17432@greed.delorie.com> <200304302031.h3UKVL911399@desire.geoffk.org> <200304302310.h3UNArW18812@greed.delorie.com> <200305010023.h410NS711520@desire.geoffk.org> <20030501015815.GW697@redhat.com>
> 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.