This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

3.0 bogus file information in debugging output


3.0.3 seems to have the same bug with functions with #line in the
middle, that Neil fixed for the mainline not so long ago.  I think
this is worth addressing in 3.0.4.

(There's still a bug with this stuff in 3.1, see next message.)

zw

$ cat test.c
int main(void) {
  int i = 0;
#line __LINE__ "foo.c"
  i++;
#line __LINE__ "bar.c"
  return i;
}
$ gcc-3.0 -S -g -v test.c
Reading specs from /usr/lib/gcc-lib/i386-linux/3.0.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.0.3
 /usr/lib/gcc-lib/i386-linux/3.0.3/cc1 -lang-c -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=3 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i386__ test.c -quiet -dumpbase test.c -g -version -o test.s
GNU CPP version 3.0.3 (cpplib) (i386 Linux/ELF)
GNU C version 3.0.3 (i386-linux)
        compiled by GNU C version 3.0.3.
ignoring nonexistent directory "/usr/i386-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc-lib/i386-linux/3.0.3/include
 /usr/include
End of search list.
$ sed -n '/^main:/,/^\.Lfe1:/p' test.s
main:
	.stabs	"bar.c",132,0,0,.Ltext1
.Ltext1:
	.stabn 68,0,1,.LM1-main
.LM1:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$8, %esp
	andl	$-16, %esp
.LBB2:
	.stabs	"test.c",132,0,0,.Ltext2
.Ltext2:
	.stabn 68,0,2,.LM2-main
.LM2:
	movl	$0, -4(%ebp)
	.stabs	"bar.c",132,0,0,.Ltext3
.Ltext3:
	.stabn 68,0,3,.LM3-main
.LM3:
	leal	-4(%ebp), %eax
	incl	(%eax)
	.stabn 68,0,4,.LM4-main
.LM4:
	movl	-4(%ebp), %eax
.LBE2:
	.stabn 68,0,5,.LM5-main
.LM5:
	leave
	ret
.Lfe1:


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