This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: subreg_get_info vs mode restrictions in registers?
- From: Ian Lance Taylor <iant at google dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 24 Jan 2007 13:34:10 -0800
- Subject: Re: subreg_get_info vs mode restrictions in registers?
- References: <200701242041.l0OKfsL3029775@greed.delorie.com>
DJ Delorie <dj@redhat.com> writes:
> subreg_get_inf() in rtlanal.c blindly assumes that any hard register
> can hold any smaller-than-native mode:
>
> nregs_ymode = hard_regno_nregs[xregno][ymode];
> . . .
> && (GET_MODE_SIZE (ymode) % nregs_ymode) == 0)
>
> However, there are registers in m32c that cannot hold a QImode value.
> By this, I mean there are NO opcodes that deal with a QImode subset of
> the 16 bits in $r2 or $r3.
>
> So which assumption is valid: that there can be registers that cannot
> be subreg'd, or that all registers can be subreg'd?
I believe we've generally assumed that all hard registers can be
subreg'd. That said, HARD_REGNO_MODE_OK should keep QImode values out
of those registers. And insn constraints should keep reload from
using those registers for QImode insns. So can you expand on what is
actually going wrong?
Ian