This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Remove mode argument from gen_rtx_SET
- From: DJ Delorie <dj at redhat dot com>
- To: Richard Sandiford <richard dot sandiford at arm dot com>
- Cc: Franz dot Sirl-kernel at lauterbach dot com, segher at kernel dot crashing dot org, gcc-patches at gcc dot gnu dot org, richard dot sandiford at arm dot com
- Date: Mon, 11 May 2015 12:55:16 -0400
- Subject: Re: Remove mode argument from gen_rtx_SET
- Authentication-results: sourceware.org; auth=none
- References: <87ioc4vct9 dot fsf at e105548-lin dot cambridge dot arm dot com> <554C90BE dot 5080105 at lauterbach dot com> <20150508115747 dot GA11371 at gate dot crashing dot org> <554CB17E dot 4040406 at lauterbach dot com> <877fsjupyh dot fsf at e105548-lin dot cambridge dot arm dot com> <201505081642 dot t48Ggwbp001371 at greed dot delorie dot com> <87zj5e13jn dot fsf at e105548-lin dot cambridge dot arm dot com>
> What I was confused about is that the first set isn't valid rtl.
> The SET_SRC and SET_DEST always have to have the same mode
> (or VOIDmode in the case of a CONST_INT, etc., where the mode
> is implicitly the same as the SET_DEST). So wouldn't it have
> to be:
>
> (set (reg:SI 1)
> (subreg:SI (reg:PSI 2)))
>
> or:
>
> (set (reg:PSI 1)
> (subreg:PSI (reg:SI 2)))
>
> ?
If my memory doesn't match reality, I blame my memory.
I'd have to experiment a while to dig out the details, but the key
point is that a PSI in a reg is not stored the same as a PSI subreg of
an SI reg. You have to keep that information across subregs or you
lose track of where the actual bits are.