[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/628] New: gas emits duplicate line-number info for each instruc

From: davidm at hpl dot hp dot com
Subject: [Bug gas/628] New: gas emits duplicate line-number info for each instruction
Date: 31 Dec 2004 02:07:29 -0000

gas generates very inefficient line-number debug-info for non-assembly programs.
 The bug was introduced back in 2002 by this change:

2002-04-17  Geoffrey Keating  <address@hidden>
   * dwarf2dbg.c (dwarf2_gen_line_info): Do emit duplicate line
     numbers, gdb relies on them to detect the start of the prologue.

This change is legitimate and needed (otherwise, gdb may not be able to set
a breakpoint at the end of a prologue of a function if the first statement
of that function appears on the same line as the function name), but since
tc-ia64.c wasn't updated, it has the effect that each time an instruction is
emitted for a non-assembly file, the line-number info will be emitted again,
even if it didn't change at all.  The end-effect is that the line-number info
ends up being needlessly big.

The problem can be easily demonstrated:

$ cat ltst.c
#include <stdio.h>
int main (int argc, char **argv) { int i; printf ("hello\n");
  for (i = 0; i < argc; ++i)
    printf ("argv[%d] = %s\n", i, argv[i]);
  return 0;
$ gcc -g -O -c ltst.c
$ readelf -wl ltst.o |fgrep -e opcode -e Advance|wc -l

That is, there are 28 line-number directives for a function that is just 4 lines

           Summary: gas emits duplicate line-number info for each
           Product: binutils
           Version: 2.15
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: davidm at hpl dot hp dot com
                CC: bug-binutils at gnu dot org,hjl at lucon dot org,wilson
                    at specifixinc dot com
 GCC build triplet: ia64-linux
  GCC host triplet: ia64-linux
GCC target triplet: ia64-linux


------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]