OSDN Git Service

* function.c (fixup_var_refs_1) <SET, handling VAR in SET_SRC>:
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 12 Apr 2002 11:31:25 +0000 (11:31 +0000)
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 12 Apr 2002 11:31:25 +0000 (11:31 +0000)
For paradoxical (subreg VAR), replace VAR, don't try the subreg.

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

gcc/ChangeLog
gcc/function.c

index b62485a..f773679 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-12  Hans-Peter Nilsson  <hp@bitrange.com>
+
+       * function.c (fixup_var_refs_1) <SET, handling VAR in SET_SRC>:
+       For paradoxical (subreg VAR), replace VAR, don't try the subreg.
+
 Fri Apr 12 10:51:38 2002  J"orn Rennecke <joern.rennecke@superh.com>
 
        * sh.c (broken_move): Constant 0. / 1. load is OK if there is
index 5922712..86a87ab 100644 (file)
@@ -2370,15 +2370,29 @@ fixup_var_refs_1 (var, promoted_mode, loc, insn, replacements, no_share)
          {
            rtx pat, last;
 
-           replacement = find_fixup_replacement (replacements, SET_SRC (x));
-           if (replacement->new)
-             SET_SRC (x) = replacement->new;
-           else if (GET_CODE (SET_SRC (x)) == SUBREG)
-             SET_SRC (x) = replacement->new
-               = fixup_memory_subreg (SET_SRC (x), insn, 0);
+           if (GET_CODE (SET_SRC (x)) == SUBREG
+               && (GET_MODE_SIZE (GET_MODE (SET_SRC (x)))
+                   > GET_MODE_SIZE (GET_MODE (var))))
+             {
+               /* This (subreg VAR) is now a paradoxical subreg.  We need
+                  to replace VAR instead of the subreg.  */
+               replacement = find_fixup_replacement (replacements, var);
+               if (replacement->new == NULL_RTX)
+                 replacement->new = gen_reg_rtx (GET_MODE (var));
+               SUBREG_REG (SET_SRC (x)) = replacement->new;
+             }
            else
-             SET_SRC (x) = replacement->new
-               = fixup_stack_1 (SET_SRC (x), insn);
+             {
+               replacement = find_fixup_replacement (replacements, SET_SRC (x));
+               if (replacement->new)
+                 SET_SRC (x) = replacement->new;
+               else if (GET_CODE (SET_SRC (x)) == SUBREG)
+                 SET_SRC (x) = replacement->new
+                   = fixup_memory_subreg (SET_SRC (x), insn, 0);
+               else
+                 SET_SRC (x) = replacement->new
+                   = fixup_stack_1 (SET_SRC (x), insn);
+             }
 
            if (recog_memoized (insn) >= 0)
              return;