This is the mail archive of the gcc-patches@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]

RFA: Big endian fix for subreg_regno_offset


-- 
--------------------------
SuperH
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330
AFAICR the SUBREG_BYTE introduction was supposed to get rid of
most of the CLASS_CANNOT_CHANGE_MODE sillyness.  However, it
still doesn't work right for big endian, because when faced
with paradoxical subregs, it always says the offset is 0.
This is not appropriate when the smaller mode uses less
registers than the larger one, e.g. fr0 and fr1 can hold DImode,
and the SImode lowpart is in fr1.

Mon Jul 15 16:39:51 2002  J"orn Rennecke <joern.rennecke@superh.com>

	* rtlanal.c (subreg_regno_offset): Return currect offset for
	big endian paradoxical subregs.

Index: rtlanal.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtlanal.c,v
retrieving revision 1.135
diff -p -r1.135 rtlanal.c
*** rtlanal.c	2 Jun 2002 07:41:59 -0000	1.135
--- rtlanal.c	15 Jul 2002 15:39:45 -0000
*************** subreg_regno_offset (xregno, xmode, offs
*** 3117,3122 ****
--- 3117,3130 ----
  
    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;
  

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