This is the mail archive of the binutils@sourceware.org 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]

fix Xtensa gas relaxation bug


This patch fixes a bug in the Xtensa relaxation code. The "steps_taken" counter, which is used to ensure the relaxation is monotonic, was not being properly incremented. This could potentially cause GAS to get stuck in an infinite loop. Tested with an xtensa-elf target and committed on the mainline.

2006-02-09 David Heine <dlheine@tensilica.com>

	* config/tc-xtensa.c (xg_assembly_relax): Increment steps_taken for
	each relaxation step.

Index: config/tc-xtensa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-xtensa.c,v
retrieving revision 1.55
diff -u -p -r1.55 tc-xtensa.c
--- config/tc-xtensa.c	31 Jan 2006 19:36:57 -0000	1.55
+++ config/tc-xtensa.c	10 Feb 2006 00:51:40 -0000
@@ -3563,10 +3563,10 @@ xg_assembly_relax (IStack *istack,
   /* Walk through all of the single instruction expansions.  */
   while (xg_is_single_relaxable_insn (&current_insn, &single_target, FALSE))
     {
+      steps_taken++;
       if (xg_symbolic_immeds_fit (&single_target, pc_seg, pc_frag, pc_offset,
 				  stretch))
 	{
-	  steps_taken++;
 	  if (steps_taken >= min_steps)
 	    {
 	      istack_push (istack, &single_target);

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