-Mon Jul 22 15:21:41 2002 J"orn Rennecke <joern.rennecke@superh.com>
+Mon Jul 22 15:27:25 2002 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * rtlanal.c (subreg_regno_offset): Return correct offset for
+ big endian paradoxical subregs.
* optabs.c (expand_vector_unop): Don't expand using sub_optab
if we got the wrong mode.
nregs_xmode = HARD_REGNO_NREGS (xregno, xmode);
nregs_ymode = HARD_REGNO_NREGS (xregno, ymode);
+
+ /* If this is a big endian paradoxical subreg, which uses more actual
+ hard registers than the original register, we must return a negative
+ offset so that we find the proper highpart of the register. */
+ if (offset == 0
+ && nregs_ymode > nregs_xmode
+ && (GET_MODE_SIZE (ymode) > UNITS_PER_WORD
+ ? WORDS_BIG_ENDIAN : BYTES_BIG_ENDIAN))
+ return nregs_xmode - nregs_ymode;
+
if (offset == 0 || nregs_xmode == nregs_ymode)
return 0;