public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/29614] New: DWARF information for function static variable is missing after unrelated code addition
@ 2006-10-27 12:43 fnf at specifixinc dot com
2006-10-28 18:49 ` [Bug debug/29614] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: fnf at specifixinc dot com @ 2006-10-27 12:43 UTC (permalink / raw)
To: gcc-bugs
A bunch of tests in the gdb testsuite dealing with static variables inside
function scopes have started failing recently with the latest development gcc.
I simplified the test case down to a small program that shows that simply
adding a small bit of unrelated code causes the DWARF information to disappear.
Here is a typescript:
Script started on Tue 24 Oct 2006 08:58:44 PM MST
$ cat b.c
int bar ()
{
static int funclocal = 4; /* In data section */
return funclocal;
}
int foo ()
{
static int funclocal = 3; /* In Data section */
return funclocal;
}
#ifdef EXPOSEBUG
void bell ()
{
static int usedval;
}
#endif
main ()
{
extern void exit (int);
exit (bar() + foo());
}
$ gcc -g -o b b.c
$ readelf --debug-dump b | grep funclocal
DW_AT_name : (indirect string, offset: 0x0): funclocal
DW_AT_name : (indirect string, offset: 0x0): funclocal
DW_AT_name : (indirect string, offset: 0x0): funclocal
0x00000000 66756e63 6c6f6361 6c00 funclocal.
$ gcc -DEXPOSEBUG -g -o b b.c
$ readelf --debug-dump b | grep funclocal
DW_AT_name : funclocal
$ gdb b
GNU gdb 6.5.50.20060923-cvs
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) br foo
Breakpoint 1 at 0x8048361: file b.c, line 10.
(gdb) br bar
Breakpoint 2 at 0x8048357: file b.c, line 4.
(gdb) run
Starting program:
/media/backups/new/build/specifix/experimental/i686-pc-linux-gnu/gdb/gdb/testsuite/b
Breakpoint 2, bar () at b.c:4
4 return funclocal;
(gdb) p funclocal
No symbol "funclocal" in current context.
(gdb) c
Continuing.
Breakpoint 1, foo () at b.c:10
10 return funclocal;
(gdb) p funclocal
$1 = 3
(gdb) quit
The program is running. Exit anyway? (y or n) y
$ exit
Script done on Tue 24 Oct 2006 08:59:51 PM MST
--
Summary: DWARF information for function static variable is
missing after unrelated code addition
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: debug
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fnf at specifixinc dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29614
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug debug/29614] [4.2/4.3 Regression] DWARF information for function static variable is missing after unrelated code addition
2006-10-27 12:43 [Bug debug/29614] New: DWARF information for function static variable is missing after unrelated code addition fnf at specifixinc dot com
@ 2006-10-28 18:49 ` pinskia at gcc dot gnu dot org
2006-12-21 23:20 ` sje at cup dot hp dot com
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-28 18:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-10-28 18:49 -------
Confirmed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
GCC build triplet|i686-pc-linux-gnu |
GCC host triplet|i686-pc-linux-gnu |
Keywords| |wrong-debug
Last reconfirmed|0000-00-00 00:00:00 |2006-10-28 18:49:28
date| |
Summary|DWARF information for |[4.2/4.3 Regression] DWARF
|function static variable is |information for function
|missing after unrelated code|static variable is missing
|addition |after unrelated code
| |addition
Target Milestone|--- |4.2.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29614
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug debug/29614] [4.2/4.3 Regression] DWARF information for function static variable is missing after unrelated code addition
2006-10-27 12:43 [Bug debug/29614] New: DWARF information for function static variable is missing after unrelated code addition fnf at specifixinc dot com
2006-10-28 18:49 ` [Bug debug/29614] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
@ 2006-12-21 23:20 ` sje at cup dot hp dot com
2006-12-22 0:54 ` hubicka at ucw dot cz
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: sje at cup dot hp dot com @ 2006-12-21 23:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from sje at cup dot hp dot com 2006-12-21 23:20 -------
This bug only occurs when NOT in -funit-at-a-time mode. Is there a plan to
switch all front-ends to unit-at-a-time compilation (which will fix this bug)
or is it still worth coming up with a fix for NON unit-at-a-time usage? The
problem seems to be when moving declarations from the varpool_nodes_queue to
the varpool_assembled_nodes_queue in varpool_assemble_pending_decls
(varpool.c). This routine gets called multiple times with a decl and we wind
up putting a declaration on the varpool_assembled_nodes_queue multiple times,
messing up the next_needed links in this linked list.
--
sje at cup dot hp dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sje at cup dot hp dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29614
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug debug/29614] [4.2/4.3 Regression] DWARF information for function static variable is missing after unrelated code addition
2006-10-27 12:43 [Bug debug/29614] New: DWARF information for function static variable is missing after unrelated code addition fnf at specifixinc dot com
2006-10-28 18:49 ` [Bug debug/29614] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
2006-12-21 23:20 ` sje at cup dot hp dot com
@ 2006-12-22 0:54 ` hubicka at ucw dot cz
2007-02-19 20:36 ` mmitchel at gcc dot gnu dot org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: hubicka at ucw dot cz @ 2006-12-22 0:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from hubicka at ucw dot cz 2006-12-22 00:54 -------
Subject: Re: [4.2/4.3 Regression] DWARF information for function static
variable is missing after unrelated code addition
Hi,
Even if all frontends can do unit-at-a-time, non-unit-at-a-time is,
sadly, still essential for Java. For Java it is common to do link-time
optimizations and our memory consumption with unit-at-a-time is too
large for this. So fixing it is desirable. Thank you for looking into
this!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29614
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug debug/29614] [4.2/4.3 Regression] DWARF information for function static variable is missing after unrelated code addition
2006-10-27 12:43 [Bug debug/29614] New: DWARF information for function static variable is missing after unrelated code addition fnf at specifixinc dot com
` (2 preceding siblings ...)
2006-12-22 0:54 ` hubicka at ucw dot cz
@ 2007-02-19 20:36 ` mmitchel at gcc dot gnu dot org
2007-02-20 21:40 ` patchapp at dberlin dot org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-19 20:36 UTC (permalink / raw)
To: gcc-bugs
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29614
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug debug/29614] [4.2/4.3 Regression] DWARF information for function static variable is missing after unrelated code addition
2006-10-27 12:43 [Bug debug/29614] New: DWARF information for function static variable is missing after unrelated code addition fnf at specifixinc dot com
` (3 preceding siblings ...)
2007-02-19 20:36 ` mmitchel at gcc dot gnu dot org
@ 2007-02-20 21:40 ` patchapp at dberlin dot org
2007-02-24 0:11 ` sje at gcc dot gnu dot org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: patchapp at dberlin dot org @ 2007-02-20 21:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from patchapp at dberlin dot org 2007-02-20 21:40 -------
Subject: Bug number PR debug/29614
A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-02/msg01728.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29614
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug debug/29614] [4.2/4.3 Regression] DWARF information for function static variable is missing after unrelated code addition
2006-10-27 12:43 [Bug debug/29614] New: DWARF information for function static variable is missing after unrelated code addition fnf at specifixinc dot com
` (4 preceding siblings ...)
2007-02-20 21:40 ` patchapp at dberlin dot org
@ 2007-02-24 0:11 ` sje at gcc dot gnu dot org
2007-03-05 23:52 ` [Bug debug/29614] [4.2 " sje at gcc dot gnu dot org
2007-03-05 23:56 ` pinskia at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: sje at gcc dot gnu dot org @ 2007-02-24 0:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from sje at gcc dot gnu dot org 2007-02-24 00:11 -------
Subject: Bug 29614
Author: sje
Date: Sat Feb 24 00:11:39 2007
New Revision: 122277
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122277
Log:
PR debug/29614
* varpool.c (varpool_assemble_pending_decls): Set
varpool_last_needed_node to null.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/varpool.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29614
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug debug/29614] [4.2 Regression] DWARF information for function static variable is missing after unrelated code addition
2006-10-27 12:43 [Bug debug/29614] New: DWARF information for function static variable is missing after unrelated code addition fnf at specifixinc dot com
` (5 preceding siblings ...)
2007-02-24 0:11 ` sje at gcc dot gnu dot org
@ 2007-03-05 23:52 ` sje at gcc dot gnu dot org
2007-03-05 23:56 ` pinskia at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: sje at gcc dot gnu dot org @ 2007-03-05 23:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from sje at gcc dot gnu dot org 2007-03-05 23:52 -------
Subject: Bug 29614
Author: sje
Date: Mon Mar 5 23:52:09 2007
New Revision: 122583
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122583
Log:
Backported from mainline
PR debug/29614
* cgraph.h (cgraph_varpool_last_needed_node): Make global.
* cgraph.c (cgraph_varpool_last_needed_node): Ditto.
* cgraphunit.c (cgraph_varpool_assemble_pending_decls):
Set cgraph_varpool_last_needed_node to NULL.
Modified:
branches/gcc-4_2-branch/gcc/ChangeLog
branches/gcc-4_2-branch/gcc/cgraph.c
branches/gcc-4_2-branch/gcc/cgraph.h
branches/gcc-4_2-branch/gcc/cgraphunit.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29614
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug debug/29614] [4.2 Regression] DWARF information for function static variable is missing after unrelated code addition
2006-10-27 12:43 [Bug debug/29614] New: DWARF information for function static variable is missing after unrelated code addition fnf at specifixinc dot com
` (6 preceding siblings ...)
2007-03-05 23:52 ` [Bug debug/29614] [4.2 " sje at gcc dot gnu dot org
@ 2007-03-05 23:56 ` pinskia at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-05 23:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pinskia at gcc dot gnu dot org 2007-03-05 23:56 -------
Fixed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29614
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-03-05 23:56 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-27 12:43 [Bug debug/29614] New: DWARF information for function static variable is missing after unrelated code addition fnf at specifixinc dot com
2006-10-28 18:49 ` [Bug debug/29614] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
2006-12-21 23:20 ` sje at cup dot hp dot com
2006-12-22 0:54 ` hubicka at ucw dot cz
2007-02-19 20:36 ` mmitchel at gcc dot gnu dot org
2007-02-20 21:40 ` patchapp at dberlin dot org
2007-02-24 0:11 ` sje at gcc dot gnu dot org
2007-03-05 23:52 ` [Bug debug/29614] [4.2 " sje at gcc dot gnu dot org
2007-03-05 23:56 ` pinskia at gcc dot gnu dot org
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).