From: Bernd Schmidt Date: Fri, 1 Dec 2006 15:49:55 +0000 (+0000) Subject: bfin.c (bfin_valid_add): Fix the logic that ensures multiword accesses are in range. X-Git-Tag: releases/gcc-4.3.0~8194 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5308e943096315fecd571582b8ca50396ff0cacc;p=thirdparty%2Fgcc.git bfin.c (bfin_valid_add): Fix the logic that ensures multiword accesses are in range. * config/bfin/bfin.c (bfin_valid_add): Fix the logic that ensures multiword accesses are in range. From-SVN: r119402 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 52452d516292..b338a90e429e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2006-12-01 Bernd Schmidt + + * config/bfin/bfin.c (bfin_valid_add): Fix the logic that ensures + multiword accesses are in range. + 2006-12-01 Zdenek Dvorak PR tree-optimization/29921 diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index 8a0026857171..f305d6bf9cf1 100644 --- a/gcc/config/bfin/bfin.c +++ b/gcc/config/bfin/bfin.c @@ -2339,8 +2339,9 @@ bfin_valid_add (enum machine_mode mode, HOST_WIDE_INT value) int shift = sz == 1 ? 0 : sz == 2 ? 1 : 2; /* The usual offsettable_memref machinery doesn't work so well for this port, so we deal with the problem here. */ - unsigned HOST_WIDE_INT mask = sz == 8 ? 0x7ffe : 0x7fff; - return (v & ~(mask << shift)) == 0; + if (value > 0 && sz == 8) + v += 4; + return (v & ~(0x7fff << shift)) == 0; } static bool