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

Bug#588087: gcc-4.4: wrong line numbers in error messages for inline assembler statements



Package: gcc-4.4
Version: 4.4.4-5
Severity: minor

*** Please type your report below this line ***

For error messages concerning inline assembler statements, gcc
counts embedded "\n" characters towards the line number, instead of
actual newlines in the source file, so the error messages refer to
the wrong lines.

Compiling the test program below with "gcc asm-line-number.c" gives
this output:

asm-line-number.c: Assembler messages:
asm-line-number.c:3: Error: no such instruction: `foo'
asm-line-number.c:4: Error: no such instruction: `foo'
asm-line-number.c:8: Error: no such instruction: `foo'

In f1(), both asm errors are in the same source line (3), but gcc
counts them as different because of the "\n" between them.

In f2(), the line number refers to the line (8) which contains
"__asm__" instead of the line (10) with the actual asm code.

static void f1 ()
{
  __asm__ ("foo\nfoo");
}

static void f2 ()
{
  __asm__
    (
      "foo"
    );
}

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.34 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages gcc-4.4 depends on:
ii  binutils                      2.20.1-11  The GNU assembler, linker and bina
ii  cpp-4.4                       4.4.4-5    The GNU C preprocessor
ii  gcc-4.4-base                  4.4.4-5    The GNU Compiler Collection (base 
ii  libc6                         2.11.2-2   Embedded GNU C Library: Shared lib
ii  libgcc1                       1:4.4.4-5  GCC support library
ii  libgomp1                      4.4.4-5    GCC OpenMP (GOMP) support library

Versions of packages gcc-4.4 recommends:
ii  libc6-dev                     2.11.2-2   Embedded GNU C Library: Developmen

Versions of packages gcc-4.4 suggests:
ii  gcc-4.4-doc                  4.4.4.nf1-1 documentation for the GNU compiler
pn  gcc-4.4-locales              <none>      (no description available)
pn  gcc-4.4-multilib             <none>      (no description available)
pn  libcloog-ppl0                <none>      (no description available)
pn  libgcc1-dbg                  <none>      (no description available)
pn  libgomp1-dbg                 <none>      (no description available)
pn  libmudflap0-4.4-dev          <none>      (no description available)
pn  libmudflap0-dbg              <none>      (no description available)
pn  libppl-c2                    <none>      (no description available)
pn  libppl7                      <none>      (no description available)

-- no debconf information



Reply to: