This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

yet another IA-64 patch for -falign-loops problems


This fixes a problem that shows up while building the linux kernel with
-falign-loops.  We end up with some unwind directives before .align
directives, which triggers a warning.  The warning isn't very useful
here, and it is easier to fix gas than gcc, so we changed gas to allow
any unwind directive which doesn't have a t (time) field before a .align
directive.  These are directives that don't correspond to a particular
instruction, so it is OK for them to be followed by nops.

2004-02-18  David Mosberger  <davidm@hpl.hp.com>

	* config/tc-ia64.c (ia64_flush_insns): In addition to prologue,
	body, and endp, allow unwind records which do not have a "t"
	(time/instruction) field.

Index: config/tc-ia64.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ia64.c,v
retrieving revision 1.101
diff -p -r1.101 tc-ia64.c
*** config/tc-ia64.c	11 Feb 2004 01:35:14 -0000	1.101
--- config/tc-ia64.c	19 Feb 2004 01:23:28 -0000
*************** ia64_flush_insns ()
*** 1092,1105 ****
       here.  Give an error for others.  */
    for (ptr = unwind.current_entry; ptr; ptr = ptr->next)
      {
!       if (ptr->r.type == prologue || ptr->r.type == prologue_gr
! 	  || ptr->r.type == body || ptr->r.type == endp)
  	{
  	  ptr->slot_number = (unsigned long) frag_more (0);
  	  ptr->slot_frag = frag_now;
  	}
-       else
- 	as_bad (_("Unwind directive not followed by an instruction."));
      }
    unwind.current_entry = NULL;
  
--- 1092,1127 ----
       here.  Give an error for others.  */
    for (ptr = unwind.current_entry; ptr; ptr = ptr->next)
      {
!       switch (ptr->r.type)
  	{
+ 	case prologue:
+ 	case prologue_gr:
+ 	case body:
+ 	case endp:
  	  ptr->slot_number = (unsigned long) frag_more (0);
  	  ptr->slot_frag = frag_now;
+ 	  break;
+ 
+ 	  /* Allow any record which doesn't have a "t" field (i.e.,
+ 	     doesn't relate to a particular instruction).  */
+ 	case unwabi:
+ 	case br_gr:
+ 	case copy_state:
+ 	case fr_mem:
+ 	case frgr_mem:
+ 	case gr_gr:
+ 	case gr_mem:
+ 	case label_state:
+ 	case rp_br:
+ 	case spill_base:
+ 	case spill_mask:
+ 	  /* nothing */
+ 	  break;
+ 
+ 	default:
+ 	  as_bad (_("Unwind directive not followed by an instruction."));
+ 	  break;
  	}
      }
    unwind.current_entry = NULL;
  
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


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