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]

add error check for Xtensa GAS port


This patch adds an error check for a label in the middle of an Xtensa FLIX (i.e., VLIW) instruction bundle. That would make no sense and if we don't detect it here, it leads to strange and incorrect behavior later. Built and tested with an xtensa-elf target. Committed on the mainline.

2005-09-30 Bob Wilson <bob.wilson@acm.org>

* config/tc-xtensa.c (xtensa_frob_label): Disallow labels in bundles.


Index: config/tc-xtensa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-xtensa.c,v
retrieving revision 1.45
diff -u -p -r1.45 tc-xtensa.c
--- config/tc-xtensa.c	20 Sep 2005 18:24:48 -0000	1.45
+++ config/tc-xtensa.c	30 Sep 2005 21:51:53 -0000
@@ -5030,7 +5030,15 @@ xtensa_init_fix_data (fixS *x)
 void
 xtensa_frob_label (symbolS *sym)
 {
-  float freq = get_subseg_target_freq (now_seg, now_subseg);
+  float freq;
+
+  if (cur_vinsn.inside_bundle)
+    {
+      as_bad (_("labels are not valid inside bundles"));
+      return;
+    }
+
+  freq = get_subseg_target_freq (now_seg, now_subseg);
 
   /* Since the label was already attached to a frag associated with the
      previous basic block, it now needs to be reset to the current frag.  */

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