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]

fix target/21888


Committed to all active branches.


r~


        * config/alpha/alpha.c (alpha_align_insns): Don't insert nops
        until we've passed initial ldgp.

Index: config/alpha/alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.426
diff -u -p -d -r1.426 alpha.c
--- config/alpha/alpha.c	1 Jun 2005 08:19:44 -0000	1.426
+++ config/alpha/alpha.c	4 Jun 2005 19:21:37 -0000
@@ -8974,7 +8974,7 @@ alpha_align_insns (unsigned int max_alig
   unsigned int align;
   /* OFS is the offset of the current insn in the insn group.  */
   int ofs;
-  int prev_in_use, in_use, len;
+  int prev_in_use, in_use, len, ldgp;
   rtx i, next;
 
   /* Let shorten branches care for assigning alignments to code labels.  */
@@ -8992,6 +8992,8 @@ alpha_align_insns (unsigned int max_alig
   if (GET_CODE (i) == NOTE)
     i = next_nonnote_insn (i);
 
+  ldgp = alpha_function_needs_gp ? 8 : 0;
+
   while (i)
     {
       next = (*next_group) (i, &in_use, &len);
@@ -9047,6 +9049,10 @@ alpha_align_insns (unsigned int max_alig
 	    }
 	}
 
+      /* We may not insert padding inside the initial ldgp sequence.  */
+      else if (ldgp > 0)
+	ldgp -= len;
+
       /* If the group won't fit in the same INT16 as the previous,
 	 we need to add padding to keep the group together.  Rather
 	 than simply leaving the insn filling to the assembler, we


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