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]

arm constant pool problems


Nicholas Clark sent me the appended testcase.  With -O -fpic on arm-linux, the 
mainline compiler was generating bad assembly (also appended):

/tmp/cc7wB4Hi.s: Assembler messages:
/tmp/cc7wB4Hi.s:4391: Error: Illegal value for co-processor offset

I think this is caused by a missing check in add_minipool_backward_ref.  
minipool_barrier->address is, effectively, the address of the last word in the 
pool.  For constants of more than one word, it may be necessary to reach lower 
addresses than this.

p. 

2000-09-16  Philip Blundell  <philb@gnu.org>

	* config/arm/arm.c (add_minipool_backward_ref): Check that the
	entire object will be reachable in the constant pool.

Index: arm.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/arm/arm.c,v
retrieving revision 1.107
diff -u -p -u -p -r1.107 arm.c
--- arm.c	2000/09/08 14:26:29	1.107
+++ arm.c	2000/09/16 22:39:45
@@ -5062,7 +5062,11 @@ add_minipool_backward_ref (fix)
      than the one we are trying to add.  */
   Mnode *        min_mp = NULL;
   /* This can be negative, since it is only a constraint.  */
-  HOST_WIDE_INT  min_address = fix->address - fix->backwards;
+  /* If the object to be inserted into the pool is larger than
+     a single word, we need to take into account that all words
+     must be reachable. */
+  HOST_WIDE_INT  min_address = fix->address - fix->backwards 
+    + (fix->fix_size - 4);
   Mnode *        mp;
 
   /* If we can't reach the current pool from this insn, or if we can't

cc7wB4Hi.s.gz

ccJbiXbh.i.gz


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