public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/58283] New: Incorrect debug info when precompilation is on
@ 2013-08-30 16:02 jengelh at inai dot de
2013-09-02 11:17 ` [Bug c/58283] " rguenth at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: jengelh at inai dot de @ 2013-08-30 16:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58283
Bug ID: 58283
Summary: Incorrect debug info when precompilation is on
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: jengelh at inai dot de
Created attachment 30731
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30731&action=edit
testcase
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.7/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.7
--enable-ssp --disable-libssp --disable-libitm --disable-plugin
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib
--enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --enable-linker-build-id
--program-suffix=-4.7 --enable-linux-futex --without-system-libunwind
--with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux
Thread model: posix
gcc version 4.7.2 20130108 [gcc-4_7-branch revision 195012] (SUSE Linux)
GNU ld (GNU Binutils; openSUSE 12.3) 2.23.1
Testcase is appended. What I observe with it:
$ make
gcc-4.8 -gdwarf-2 -g3 -O0 -DPRECOMP -o pc1.h.gch -c pc1.h
gcc-4.8 -gdwarf-2 -g3 -O0 -DPRECOMP -o x m.c
nm -C x | grep main
U __libc_start_main
0000000000400560 T main
addr2line -e x $(nm -C x | grep ' main$' | awk '{print $1}')
/usr/include/stdio.h:947
What I would have expected:
Have addr2line return m.c:3.
Additional information:
I do get addr2line to output "m.c:3" if I include "pc1.h" instead of "pc.h"
from m.c. So this problem seems to be related with headers including
(precompiled) headers. In fact, gcc-4.7.2 even ignored pc1.h.gch (itself a bug,
or a non-implemented feature) if m.c includes pc.h, which means I don't get
wrong line numbers on gcc-4.7.
The outputting of wrong line numbers also occurs if compiled as C++ code.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/58283] Incorrect debug info when precompilation is on
2013-08-30 16:02 [Bug c/58283] New: Incorrect debug info when precompilation is on jengelh at inai dot de
@ 2013-09-02 11:17 ` rguenth at gcc dot gnu.org
2013-09-02 11:46 ` jengelh at inai dot de
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-09-02 11:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58283
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2013-09-02
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I get
/tmp/xtest> make
g++-4.8 -gdwarf-2 -g3 -O0 -DPRECOMP `wx-config --cflags` -o precomp1.hpp.gch -c
precomp1.hpp
/bin/sh: wx-config: command not found
g++-4.8 -gdwarf-2 -g3 -O0 -DPRECOMP `wx-config --cflags` -o xtest mainmenu.cpp
/bin/sh: wx-config: command not found
nm -C xtest | grep main
U __libc_start_main@@GLIBC_2.2.5
0000000000400620 T main
addr2line -e xtest $(nm -C xtest | grep ' main$' | awk '{print $1}')
/tmp/xtest/mainmenu.cpp:3
Same with including pecomp1.hpp from mainmenu.cpp.
(so, what does wx-config --cflags return?)
Note that you are testing GCC 4.8, not 4.7.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/58283] Incorrect debug info when precompilation is on
2013-08-30 16:02 [Bug c/58283] New: Incorrect debug info when precompilation is on jengelh at inai dot de
2013-09-02 11:17 ` [Bug c/58283] " rguenth at gcc dot gnu.org
@ 2013-09-02 11:46 ` jengelh at inai dot de
2013-09-02 12:42 ` jengelh at inai dot de
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: jengelh at inai dot de @ 2013-09-02 11:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58283
--- Comment #2 from Jan Engelhardt <jengelh at inai dot de> ---
Oh, -DPRECOMP `wx-config --cflags` is a remnant and may be removed from the
Makefile. The issue continues to be reproducible. It appears on openSUSE
Factory's gcc 4.8.
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.8/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.8
--enable-ssp --disable-libssp --disable-plugin
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib
--enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --enable-linker-build-id
--program-suffix=-4.8 --enable-linux-futex --without-system-libunwind
--with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux
Thread model: posix
gcc version 4.8.1 20130806 [gcc-4_8-branch revision 201525] (SUSE Linux)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/58283] Incorrect debug info when precompilation is on
2013-08-30 16:02 [Bug c/58283] New: Incorrect debug info when precompilation is on jengelh at inai dot de
2013-09-02 11:17 ` [Bug c/58283] " rguenth at gcc dot gnu.org
2013-09-02 11:46 ` jengelh at inai dot de
@ 2013-09-02 12:42 ` jengelh at inai dot de
2013-09-02 12:51 ` rguenth at gcc dot gnu.org
2013-09-02 19:54 ` jengelh at inai dot de
4 siblings, 0 replies; 6+ messages in thread
From: jengelh at inai dot de @ 2013-09-02 12:42 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58283
--- Comment #4 from Jan Engelhardt <jengelh at inai dot de> ---
>you cannot include a precompiled header from inside another header.
Ok. So, this limitation was properly implemented in gcc 4.7, which simply
skipped over the indirectly-included .gch file as if it did not exist. Safe
thing to do.
In gcc 4.8 however, the indirectly-included .gch *is* used rather than skipped,
which I base upon the observation that compile time goes down significantly for
projects with larger amounts of C++ code and the same indirect-inclusion
scheme.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/58283] Incorrect debug info when precompilation is on
2013-08-30 16:02 [Bug c/58283] New: Incorrect debug info when precompilation is on jengelh at inai dot de
` (2 preceding siblings ...)
2013-09-02 12:42 ` jengelh at inai dot de
@ 2013-09-02 12:51 ` rguenth at gcc dot gnu.org
2013-09-02 19:54 ` jengelh at inai dot de
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-09-02 12:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58283
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|rguenther at suse dot de |rguenth at gcc dot gnu.org
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
You mean the fix for PR38987?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/58283] Incorrect debug info when precompilation is on
2013-08-30 16:02 [Bug c/58283] New: Incorrect debug info when precompilation is on jengelh at inai dot de
` (3 preceding siblings ...)
2013-09-02 12:51 ` rguenth at gcc dot gnu.org
@ 2013-09-02 19:54 ` jengelh at inai dot de
4 siblings, 0 replies; 6+ messages in thread
From: jengelh at inai dot de @ 2013-09-02 19:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58283
--- Comment #6 from Jan Engelhardt <jengelh at inai dot de> ---
It seems to be ineffective.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-09-02 19:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-30 16:02 [Bug c/58283] New: Incorrect debug info when precompilation is on jengelh at inai dot de
2013-09-02 11:17 ` [Bug c/58283] " rguenth at gcc dot gnu.org
2013-09-02 11:46 ` jengelh at inai dot de
2013-09-02 12:42 ` jengelh at inai dot de
2013-09-02 12:51 ` rguenth at gcc dot gnu.org
2013-09-02 19:54 ` jengelh at inai dot de
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).