public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* fix Xtensa assembler relaxtion problem
@ 2005-03-11  0:14 Bob Wilson
  0 siblings, 0 replies; only message in thread
From: Bob Wilson @ 2005-03-11  0:14 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]

I've committed the following patch on both the mainline and 2.16 branch.  It 
fixes a problem with a "movi" of a large, non-symbolic immediate value in the 
last slot of an Xtensa FLIX instruction.  The "movi" operation is relaxed and 
temporarily changed to refer to an internal "SPECIAL_LITERAL" symbol, which is 
supposed to be fixed up later by the xg_resolve_literals() function.  However, 
the code to call xg_resolve_literals() was skipping the last slot of multi-slot 
instructions.  The patch corrects that (and also fixes an obviously spelling 
typo in a comment).

I ran the testsuites with an xtensa-elf target to test that this patch doesn't 
break anything.  The default Xtensa processor configuration does not currently 
include any FLIX instructions, so I can't include a testcase for this problem, 
but I have verified separately that the patch does indeed correct the problem.

2005-03-10  Bob Wilson  <bob.wilson@acm.org>

         * config/tc-xtensa.c (finish_vinsn): Include the last instruction slot
         when checking if xg_resolve_literals needs to be called.
         * config/tc-xtensa.h: Fix spelling typo in a comment.


[-- Attachment #2: gas.patch --]
[-- Type: text/x-patch, Size: 1495 bytes --]

Index: tc-xtensa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-xtensa.c,v
retrieving revision 1.22
diff -u -p -r1.22 tc-xtensa.c
--- tc-xtensa.c	3 Mar 2005 11:47:57 -0000	1.22
+++ tc-xtensa.c	10 Mar 2005 23:06:11 -0000
@@ -6145,7 +6145,7 @@ finish_vinsn (vliw_insn *vinsn)
 	      return;
 	    }
 
-	  for (j = 0; j < slotstack.ninsn - 1; j++)
+	  for (j = 0; j < slotstack.ninsn; j++)
 	    {
 	      TInsn *insn = &slotstack.insn[j];
 	      if (insn->insn_type == ITYPE_LITERAL)
@@ -6155,9 +6155,11 @@ finish_vinsn (vliw_insn *vinsn)
 		}
 	      else
 		{
+		  assert (insn->insn_type == ITYPE_INSN);
 		  if (lit_sym)
 		    xg_resolve_literals (insn, lit_sym);
-		  emit_single_op (insn);
+		  if (j != slotstack.ninsn - 1)
+		    emit_single_op (insn);
 		}
 	    }
 
Index: tc-xtensa.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-xtensa.h,v
retrieving revision 1.7
diff -u -p -r1.7 tc-xtensa.h
--- tc-xtensa.h	4 Nov 2004 21:52:54 -0000	1.7
+++ tc-xtensa.h	10 Mar 2005 23:06:11 -0000
@@ -201,7 +201,7 @@ struct xtensa_frag_type
      first time through a relaxation....  */
   unsigned int relax_seen : 1;
 
-  /* Infomation that is needed in the object file and set when known.  */
+  /* Information that is needed in the object file and set when known.  */
   unsigned int is_literal : 1;
   unsigned int is_loop_target : 1;
   unsigned int is_branch_target : 1;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-11  0:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-11  0:14 fix Xtensa assembler relaxtion problem Bob Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).