tag 635592 + patch
thanks

On Wed, Jul 27, 2011 at 02:14:22PM +0300, Modestas Vainius wrote:
> Package: binutils
> Version: 2.21.52.20110707-1
> Severity: serious
> Justifaction: causes other packages to FTBFS on mips/mipsel
> 
> Hello,
> 
> It seems that binutils has regressed on mipsel and mips. The failure is like:
> 
> /tmp/cce8vszV.s: Assembler messages:
> /tmp/cce8vszV.s: Internal error!
> Assertion failure in emit_inc_line_addr at ../../gas/dwarf2dbg.c line 926.
> Please report this bug.
> 
> Regression was probably introduced in binutils_2.21.52.20110703-1 since that
> release includes big gas related changes. However, I can't confirm that since
> none of buildds use it anymore so lets assume that regression was introduced 
> in
> binutils_2.21.52.20110707-1. Logs of some failures are below:
> 
> * binutils_2.21.53.20110720-1:
> 
> https://buildd.debian.org/status/fetch.php?pkg=kdebase-workspace&arch=mips&ver=4%3A4.6.5-1&stamp=1311462730
> https://buildd.debian.org/status/fetch.php?pkg=kdebase-workspace&arch=mipsel&ver=4%3A4.6.5-2&stamp=1311720152
> https://buildd.debian.org/status/fetch.php?pkg=kdesdk&arch=mips&ver=4%3A4.6.5-1&stamp=1311500965
> https://buildd.debian.org/status/fetch.php?pkg=kdesdk&arch=mipsel&ver=4%3A4.6.5-1&stamp=1311328518
> https://buildd.debian.org/status/fetch.php?pkg=kdebase&arch=mips&ver=4%3A4.6.5-1&stamp=1311458085
> https://buildd.debian.org/status/fetch.php?pkg=kdebase&arch=mips&ver=4%3A4.6.5-1&stamp=1311256019
> 
> * binutils_2.21.52.20110707-1
> 
> https://buildd.debian.org/status/fetch.php?pkg=kdebase-workspace&arch=mips&ver=4%3A4.6.5-1&stamp=1311092775
> https://buildd.debian.org/status/fetch.php?pkg=kdebase&arch=mips&ver=4%3A4.6.5-1&stamp=1311076807
> 
> The same packages succeed if they get built with binutils_2.21.52.20110606-2:
> 
> https://buildd.debian.org/status/fetch.php?pkg=kdebase-workspace&arch=mips&ver=4%3A4.6.5-1&stamp=1311492656
> https://buildd.debian.org/status/fetch.php?pkg=kdebase&arch=mips&ver=4%3A4.6.5-1&stamp=1311466122
> 
> There seem to have been some changes to the gas/mips* area in the upstream VCS
> repository. Maybe you should try to package a new upstream snapshot.

The bug has been fixed upstream, an I confirm the patch committed
upstream indeed fixes the issue. Please find attached a patch to drop in
debian/patches.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurel...@aurel32.net                 http://www.aurel32.net
2011-09-05  Richard Sandiford  <rdsandif...@googlemail.com>

	PR gas/13024
	* dwarf2dbg.c (pending_lines, pending_lines_tail): New variables.
	(dwarf2_gen_line_info_1): Delete.
	(dwarf2_push_line, dwarf2_flush_pending_lines): New functions.
	(dwarf2_gen_line_info, dwarf2_emit_label): Use them.
	(dwarf2_consume_line_info): Call dwarf2_flush_pending_lines.
	(dwarf2_directive_loc): Push previous .locs instead of generating
	them immediately.

===================================================================
RCS file: /cvs/src/src/gas/dwarf2dbg.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -r1.112 -r1.113
--- src/gas/dwarf2dbg.c	2011/07/28 16:35:46	1.112
+++ src/gas/dwarf2dbg.c	2011/09/05 19:18:59	1.113
@@ -207,6 +207,10 @@
   0
 };
 
+/* Lines that are at the same location as CURRENT, and which are waiting
+   for a label.  */
+static struct line_entry *pending_lines, **pending_lines_tail = &pending_lines;
+
 /* The size of an address on the target.  */
 static unsigned int sizeof_address;
 
@@ -280,22 +284,47 @@
   return lss;
 }
 
-/* Record an entry for LOC occurring at LABEL.  */
+/* Push LOC onto the pending lines list.  */
 
 static void
-dwarf2_gen_line_info_1 (symbolS *label, struct dwarf2_line_info *loc)
+dwarf2_push_line (struct dwarf2_line_info *loc)
 {
-  struct line_subseg *lss;
   struct line_entry *e;
 
   e = (struct line_entry *) xmalloc (sizeof (*e));
   e->next = NULL;
-  e->label = label;
+  e->label = NULL;
   e->loc = *loc;
 
-  lss = get_line_subseg (now_seg, now_subseg);
-  *lss->ptail = e;
-  lss->ptail = &e->next;
+  *pending_lines_tail = e;
+  pending_lines_tail = &(*pending_lines_tail)->next;
+}
+
+/* Emit all pending line information.  LABEL is the label with which the
+   lines should be associated, or null if they should be associated with
+   the current position.  */
+
+static void
+dwarf2_flush_pending_lines (symbolS *label)
+{
+  if (pending_lines)
+    {
+      struct line_subseg *lss;
+      struct line_entry *e;
+
+      if (!label)
+	label = symbol_temp_new (now_seg, 0, frag_now);
+
+      for (e = pending_lines; e; e = e->next)
+	e->label = label;
+
+      lss = get_line_subseg (now_seg, now_subseg);
+      *lss->ptail = pending_lines;
+      lss->ptail = pending_lines_tail;
+
+      pending_lines = NULL;
+      pending_lines_tail = &pending_lines;
+    }
 }
 
 /* Record an entry for LOC occurring at OFS within the current fragment.  */
@@ -306,8 +335,6 @@
   static unsigned int line = -1;
   static unsigned int filenum = -1;
 
-  symbolS *sym;
-
   /* Early out for as-yet incomplete location information.  */
   if (loc->filenum == 0 || loc->line == 0)
     return;
@@ -323,8 +350,8 @@
   line = loc->line;
   filenum = loc->filenum;
 
-  sym = symbol_temp_new (now_seg, ofs, frag_now);
-  dwarf2_gen_line_info_1 (sym, loc);
+  dwarf2_push_line (loc);
+  dwarf2_flush_pending_lines (symbol_temp_new (now_seg, ofs, frag_now));
 }
 
 /* Returns the current source information.  If .file directives have
@@ -385,6 +412,11 @@
 void
 dwarf2_consume_line_info (void)
 {
+  /* If the consumer has stashed the current location away for later use,
+     assume that any earlier location information should be associated
+     with ".".  */
+  dwarf2_flush_pending_lines (NULL);
+
   /* Unless we generate DWARF2 debugging information for each
      assembler line, we only emit one line symbol for one LOC.  */
   dwarf2_loc_directive_seen = FALSE;
@@ -416,7 +448,8 @@
 
   loc.flags |= DWARF2_FLAG_BASIC_BLOCK;
 
-  dwarf2_gen_line_info_1 (label, &loc);
+  dwarf2_push_line (&loc);
+  dwarf2_flush_pending_lines (label);
   dwarf2_consume_line_info ();
 }
 
@@ -576,7 +609,7 @@
   /* If we see two .loc directives in a row, force the first one to be
      output now.  */
   if (dwarf2_loc_directive_seen)
-    dwarf2_emit_insn (0);
+    dwarf2_push_line (&current);
 
   filenum = get_absolute_expression ();
   SKIP_WHITESPACE ();

Reply via email to