[committed] ia64 gas patch

James E Wilson wilson@specifix.com
Fri Mar 3 01:21:00 GMT 2006


This fixes a bug reported on the ia64 linux kernel mailing list.  For
this testcase
(p10)   itc.i r18
(p11)   itc.d r18
(p6)    br.cond.spnt.many page_fault
gas was inserting two stop bits in between the itc.i and itc.d
instructions.  There should have only been one stop bit emitted here.

The itc.i instruction must be last in its instruction group, and it must
be in a M slot, which forces us to use a template that contains a stop
bit inside it.  Unfortunately, we fail to clear the bit that indicates a
stop bit is required after this instruction, thus prompting us to emit a
second spurious stop bit at the end of the bundle.  This is easily fixed
by clearing the field that indicates a stop bit is required after this
instruction.

This patch was tested against the binutils testsuite, there were no
regressions.  This patch was also tested with a linux kernel build. 
There was only one change.  The extra stop bit in the code above
disappeared, which is exactly what I wanted.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com
-------------- next part --------------
2006-03-02  James E Wilson  <wilson@specifix.com>

	* config/tc-ia64.c (emit_one_bundle): For IA64_OPCODE_LAST, if we
	change the template, then clear md.slot[curr].end_of_insn_group.

Index: tc-ia64.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ia64.c,v
retrieving revision 1.186
diff -p -p -r1.186 tc-ia64.c
*** tc-ia64.c	23 Feb 2006 21:36:17 -0000	1.186
--- tc-ia64.c	2 Mar 2006 22:32:53 -0000
*************** emit_one_bundle ()
*** 6855,6860 ****
--- 6855,6864 ----
  	         changing NOPs in front of this slot.  */
  	      for (j = i; j < 3; ++j)
  	        insn[j] = nop[ia64_templ_desc[required_template].exec_unit[j]];
+ 
+ 	      /* We just picked a template that includes the stop bit in the
+ 		 middle, so we don't need another one emitted later.  */
+ 	      md.slot[curr].end_of_insn_group = 0;
  	    }
  	  template = required_template;
  	}


More information about the Binutils mailing list