PR target/18701
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 31 Dec 2004 16:24:48 +0000 (16:24 +0000)
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 31 Dec 2004 16:24:48 +0000 (16:24 +0000)
* combine.c (gen_lowpart_for_combine): When stripping SUBREG of
MEM, adjust imode and isize.

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

gcc/ChangeLog
gcc/combine.c

index f6d95d3..81d0b99 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-31  Hans-Peter Nilsson  <hp@bitrange.com>
+
+       PR target/18701
+       * combine.c (gen_lowpart_for_combine): When stripping SUBREG of
+       MEM, adjust imode and isize.
+
 2004-12-30  Richard Henderson  <rth@redhat.com>
 
        * config/ia64/ia64.c (hfa_element_mode): Return false for 
index 800e65e..61b93dd 100644 (file)
@@ -9355,8 +9355,16 @@ gen_lowpart_for_combine (enum machine_mode omode, rtx x)
   if (GET_CODE (x) == SUBREG && MEM_P (SUBREG_REG (x)))
     {
       x = SUBREG_REG (x);
-      if (GET_MODE (x) == omode)
+
+      /* For use in case we fall down into the address adjustments
+        further below, we need to adjust the known mode and size of
+        x; imode and isize, since we just adjusted x.  */
+      imode = GET_MODE (x);
+
+      if (imode == omode)
        return x;
+
+      isize = GET_MODE_SIZE (imode);
     }
 
   result = gen_lowpart_common (omode, x);