OSDN Git Service

(eliminate_regs, case SUBREG): Leave the SUBREG when
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 2 May 1993 14:01:25 +0000 (14:01 +0000)
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 2 May 1993 14:01:25 +0000 (14:01 +0000)
the inner object is a pseudo on machines that extend byte
loads (to be consistent with reload.c).

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@4304 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/reload1.c

index 0fccda4..c963a33 100644 (file)
@@ -2787,7 +2787,17 @@ eliminate_regs (x, mem_mode, insn)
        {
          if (GET_CODE (new) == MEM
              && (GET_MODE_SIZE (GET_MODE (x))
-                 <= GET_MODE_SIZE (GET_MODE (new))))
+                 <= GET_MODE_SIZE (GET_MODE (new)))
+#if defined(BYTES_LOADS_ZERO_EXTEND) || defined(BYTE_LOADS_SIGN_EXTEND)
+             /* On these machines we will be reloading what is
+                inside the SUBREG if it originally was a pseudo and
+                the inner and outer modes are both a word or
+                smaller.  So leave the SUBREG then.  */
+             && ! (GET_CODE (SUBREG_REG (x)) == REG
+                   && GET_MODE_SIZE (GET_MODE (x)) <= UNITS_PER_WORD
+                   && GET_MODE_SIZE (GET_MODE (new)) <= UNITS_PER_WORD)
+#endif
+             )
            {
              int offset = SUBREG_WORD (x) * UNITS_PER_WORD;
              enum machine_mode mode = GET_MODE (x);