arm.c (minipool_pad): New.
authorPaul Brook <paul@codesourcery.com>
Wed, 15 Mar 2006 20:22:56 +0000 (20:22 +0000)
committerPaul Brook <pbrook@gcc.gnu.org>
Wed, 15 Mar 2006 20:22:56 +0000 (20:22 +0000)
2006-03-15  Paul Brook  <paul@codesourcery.com>

* config/arm/arm.c (minipool_pad): New.
(add_minipool_forward_ref): Unclude pool alignment padding in address
calculation.
(push_minipool_fix): Set minipool_pad.
(minipool_pad): Ditto.

From-SVN: r112099

gcc/ChangeLog
gcc/config/arm/arm.c

index 2a05ddb43f199a23ebefa38a20fe5a7dd283c85a..e0ffaa36d8172567a0c89c35b0497c8b79e6fb46 100644 (file)
@@ -1,3 +1,11 @@
+2006-03-15  Paul Brook  <paul@codesourcery.com>
+
+       * config/arm/arm.c (minipool_pad): New.
+       (add_minipool_forward_ref): Unclude pool alignment padding in address
+       calculation.
+       (push_minipool_fix): Set minipool_pad.
+       (minipool_pad): Ditto.
+
 2006-03-15  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
 
        * config/vax/vax.c (split_quadword_operands): Use MEM_P()
index 4e9ae1b6e3f0abc527a7983121f2ddf19dc57bf5..2e5c9c43bb8fbdba72fab7375cf6f507851d8bf6 100644 (file)
@@ -7308,6 +7308,7 @@ struct minipool_fixup
 static Mnode * minipool_vector_head;
 static Mnode * minipool_vector_tail;
 static rtx     minipool_vector_label;
+static int     minipool_pad;
 
 /* The linked list of all minipool fixes required for this function.  */
 Mfix *                 minipool_fix_head;
@@ -7419,7 +7420,7 @@ add_minipool_forward_ref (Mfix *fix)
   /* If set, max_mp is the first pool_entry that has a lower
      constraint than the one we are trying to add.  */
   Mnode *       max_mp = NULL;
-  HOST_WIDE_INT max_address = fix->address + fix->forwards;
+  HOST_WIDE_INT max_address = fix->address + fix->forwards - minipool_pad;
   Mnode *       mp;
 
   /* If this fix's address is greater than the address of the first
@@ -7997,12 +7998,11 @@ push_minipool_fix (rtx insn, HOST_WIDE_INT address, rtx *loc,
      to generate duff assembly code.  */
   gcc_assert (fix->forwards || fix->backwards);
 
-  /* With AAPCS/iWMMXt enabled, the pool is aligned to an 8-byte boundary.
-     So there might be an empty word before the start of the pool.
-     Hence we reduce the forward range by 4 to allow for this
-     possibility.  */
+  /* If an entry requires 8-byte alignment then assume all constant pools
+     require 4 bytes of padding.  Trying to do this later on a per-pool
+     basis is awkward becuse existing pool entries have to be modified.  */
   if (ARM_DOUBLEWORD_ALIGN && fix->fix_size == 8)
-    fix->forwards -= 4;
+    minipool_pad = 4;
 
   if (dump_file)
     {
@@ -8179,6 +8179,7 @@ arm_reorg (void)
      scan it properly.  */
   insn = get_insns ();
   gcc_assert (GET_CODE (insn) == NOTE);
+  minipool_pad = 0;
 
   /* Scan all the insns and record the operands that will need fixing.  */
   for (insn = next_nonnote_insn (insn); insn; insn = next_nonnote_insn (insn))