This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Blackfin patch: Fix ICE while compiling newlib


When testing the validity of an address for a DFmode or DImode memory
reference, we must ensure that any constant offset is in range even if
it is incremented by 4.  There is code that tries to do it, but it gets
it rather wrong: any address not a multiple of 4 is rejected.  That's
rather unfortunate when BIGGEST_ALIGNMENT is 32.

Fixed with this patch, committed as 119402.


Bernd
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 119401)
+++ ChangeLog	(working copy)
@@ -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: config/bfin/bfin.c
===================================================================
--- config/bfin/bfin.c	(revision 119366)
+++ config/bfin/bfin.c	(working copy)
@@ -2339,8 +2339,9 @@ bfin_valid_add (enum machine_mode mode, 
   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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]