This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
simplify_subreg vs gen_rtx_SUBREG vis WORDS_BIG_ENDIAN
- From: DJ Delorie <dj at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 24 Oct 2008 22:46:15 -0400
- Subject: simplify_subreg vs gen_rtx_SUBREG vis WORDS_BIG_ENDIAN
In expmed.c I see code like this:
if (REG_P (xop0) && GET_MODE (xop0) != op_mode)
xop0 = gen_rtx_SUBREG (op_mode, xop0, 0);
However, this is wrong for big-endian targets (h8300-elf in my case)
because '0' is not the offset of the LSB of the register when it's a
pseudo and op_mode is smaller than xop0's mode. IIRC simplify_subreg
does endian adjustments where gen_rtx_SUBREG does not, however,
simplify_subreg may return NULL_RTX.
What's the "right thing" to do here, these days? I've temporarily put
in a function to special case the failing case, but it seems...
inelegant. Is there a missing assumption somewhere?