]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
bfin.c (bfin_valid_add): Fix the logic that ensures multiword accesses are in range.
authorBernd Schmidt <bernd.schmidt@analog.com>
Fri, 1 Dec 2006 15:49:55 +0000 (15:49 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Fri, 1 Dec 2006 15:49:55 +0000 (15:49 +0000)
* config/bfin/bfin.c (bfin_valid_add): Fix the logic that ensures
multiword accesses are in range.

From-SVN: r119402

gcc/ChangeLog
gcc/config/bfin/bfin.c

index 52452d5162929ccb1d75a430ba54ba4335fae7f8..b338a90e429edeb38c86e4210539a452faa145fe 100644 (file)
@@ -1,3 +1,8 @@
+2006-12-01  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+       * config/bfin/bfin.c (bfin_valid_add): Fix the logic that ensures
+       multiword accesses are in range.
+
 2006-12-01  Zdenek Dvorak <dvorakz@suse.cz>
 
        PR tree-optimization/29921
index 8a0026857171eea72dee8503f4801c71a288618f..f305d6bf9cf10173f8d2a0af3304b278bd3a8936 100644 (file)
@@ -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