[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#93786: arm-loop.dpatch



Package: gcc-2.95
Version: 1:2.95.3-11

This patch fixes a problem compiling binutils on ARM.  It's already installed 
on the 2.95 branch in CVS, but if future packages are going to use the 2.95.3 
tarball it would be good to have this included.

#! /bin/sh -e

# DP: Fix for SUBREG problems

src=gcc
if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
    src=$3/gcc
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch)
        patch $pdir -f --no-backup-if-mismatch -p1 --fuzz 10 < $0
        cd $src && autoconf
        ;;
    -unpatch)
        patch $pdir -f --no-backup-if-mismatch -R -p1 --fuzz 10 < $0
        cd $src && autoconf
        ;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1
esac
exit 0

2001-04-03  Bernd Schmidt  <bernds@redhat.com>

	* loop.c (combine_movables): Restrict combinations of constants with
	different modes so that we don't introduce SUBREGs into memory
	addresses.

--- src/gcc/loop.c	2001/01/25 14:03:18	1.156.4.20
+++ src/gcc/loop.c	2001/04/03 12:09:42	1.156.4.21
@@ -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.  */





Reply to: