This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: simplify_subreg vs gen_rtx_SUBREG vis WORDS_BIG_ENDIAN
DJ Delorie <dj@redhat.com> writes:
>> One thing to do is to call simplify_gen_subreg.
>
> As I noted, that may return NULL, which is fatal in the case I'm
> referencing.
You mentioned simplify_subreg. simplify_gen_subreg will only return
NULL when the RTL is already bogus.
>> But I don't think that will help. I think this code is simply
>> incorrect. It seems to assume that op_mode is at least as large as
>> GET_MODE (xop0), probably because that will be the case on the m68k.
>
> Do we want to just fail that function if we detect the
> smaller-than-mode case? Otherwise, I've been using the below function
> to constuct endian-aware subregs, it seems to work.
I think that something like your function is correct, except that it
should call simplify_gen_subreg rather than gen_rtx_SUBREG.
Ian