]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Prevent putting SUBREGs into memory addresses without verifying them
authorBernd Schmidt <bernds@redhat.com>
Tue, 3 Apr 2001 12:09:42 +0000 (12:09 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Tue, 3 Apr 2001 12:09:42 +0000 (12:09 +0000)
From-SVN: r41054

gcc/ChangeLog
gcc/loop.c

index 78a2b8cb5f8caaad589b49585f89fd1e3701795c..ce7e2792ea720990b2bc45d02d31479ca458c8e4 100644 (file)
@@ -5,6 +5,10 @@
        Remove ia32 linux PIC kludge and move it...
        * config/i386/linux.h (CRT_END_INIT_DUMMY): ...here.
 
+       * loop.c (combine_movables): Restrict combinations of constants with
+       different modes so that we don't introduce SUBREGs into memory
+       addresses.
+
 2001-03-30  Bernd Schmidt  <bernds@redhat.com>
 
        * jump.c (delete_barrier_successors): Fix error in last change.
index aca291dd6b1fd67130bd461c5daeda95bd7280ac..eff3c4a26d9466a0f74daac93dec8275832aef37 100644 (file)
@@ -1481,10 +1481,16 @@ combine_movables (movables, nregs)
                      width as M1.  The check for integer is redundant, but
                      safe, since the only case of differing destination
                      modes with equal sources is when both sources are
-                     VOIDmode, i.e., CONST_INT.  */
+                     VOIDmode, i.e., CONST_INT.
+                   
+                     For 2.95, don't do this if the mode of M1 is Pmode.
+                     This prevents us from substituting SUBREGs for REGs
+                     in memory accesses; not all targets are prepared to
+                     handle this properly.  */
                   (GET_MODE (m->set_dest) == GET_MODE (m1->set_dest)
                    || (GET_MODE_CLASS (GET_MODE (m->set_dest)) == MODE_INT
                        && GET_MODE_CLASS (GET_MODE (m1->set_dest)) == MODE_INT
+                       && GET_MODE (m1->set_dest) != Pmode
                        && (GET_MODE_BITSIZE (GET_MODE (m->set_dest))
                            >= GET_MODE_BITSIZE (GET_MODE (m1->set_dest)))))
                   /* See if the source of M1 says it matches M.  */