From: Bernd Schmidt Date: Tue, 3 Apr 2001 12:09:42 +0000 (+0000) Subject: Prevent putting SUBREGs into memory addresses without verifying them X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d82dfa46c47c6a765ba62d29cea6227864330d67;p=thirdparty%2Fgcc.git Prevent putting SUBREGs into memory addresses without verifying them From-SVN: r41054 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 78a2b8cb5f8c..ce7e2792ea72 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 * jump.c (delete_barrier_successors): Fix error in last change. diff --git a/gcc/loop.c b/gcc/loop.c index aca291dd6b1f..eff3c4a26d94 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -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. */