This is the mail archive of the
mailing list for the GCC project.
HARD_REGNO_MODE_OK vs the register allocator
- From: Richard Henderson <rth at redhat dot com>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: dj at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Wed, 30 Apr 2003 18:58:15 -0700
- Subject: 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>
[ Subject line changed in hopes of piquing new-ra folk's interest. ]
On Wed, Apr 30, 2003 at 05:23:28PM -0700, Geoff Keating wrote:
> > How about this one? This should stop everyone from putting an SI in
> > $r7. Too bad we can't check both operands for this, as it stops us
> > from doing reg-reg moves to/from $r7/$r8 also.
> I really think it would be better to fix reload than to keep trying to
> work around this in the port.
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?
If so, I agree with Geoff that the register allocator should be
handling this. It's kind of an edge condition though -- we've said
elsewhere that it's wrong for HARD_REGNO_MODE_OK to return true for
a double-word value in the last register of the physical reg set.
We should make up our mind. Either it's the allocator's job to test
that there are indeed HARD_REGNO_NREGS remaining in the chosen class,
or HARD_REGNO_MODE_OK should instead also take the class it's supposed
to be testing against.
Personally I prefer the former.