This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]