public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14079] New: wrong debug info for extern boolean variable in debug mode
@ 2004-02-09 10:01 gcc-bugzilla at gcc dot gnu dot org
  2004-02-09 10:54 ` [Bug c++/14079] " konstantin at mysql dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2004-02-09 10:01 UTC (permalink / raw)
  To: gcc-bugs

      Compile a program attached in how-to-repeat section with
      c++ -g -ggdb foo.cc

      Run it in gdb. Exec:
      b main
      p sizeof(bool)
      p sizeof(foo)
      p sizeof(bar)
      p &foo
      p &bar
      set foo=1
      set bar=0
      set foo=1

      Note, that nevertheless pritnf() output is correct.

Environment:
System: Linux oak 2.4.21-99-athlon #1 Wed Sep 24 13:34:32 UTC 2003 i686 athlon i386 GNU/Linux
Architecture: i686

OS: SuSE Linux 9.0, GNU gdb 5.3.92 from default package. Note, that the bug
reproduces on the other developers SuSE 9.0 boxes, having earlier versions of
GCC.

host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-3.3.2/configure --enable-threads=posix --enable-languages=c,c++

How-To-Repeat:
     -- cut (foo.cc) 
#include <stdio.h>
extern bool foo;
bool foo, bar;

int main()
{
  printf("%d, %d, %d\n", sizeof(bool), sizeof(foo), sizeof(bar));
}
     -- end cut
------- Additional Comments From konstantin at mysql dot com  2004-02-09 10:01 -------
Fix:
    Work around is not use bool if bool is extern, because they are not
    operable in debug mode.

-- 
           Summary: wrong debug info for extern boolean variable in debug
                    mode
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: konstantin at mysql dot com
                CC: gcc-bugs at gcc dot gnu dot org
 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=14079


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c++/14079] wrong debug info for extern boolean variable in debug mode
  2004-02-09 10:01 [Bug c++/14079] New: wrong debug info for extern boolean variable in debug mode gcc-bugzilla at gcc dot gnu dot org
@ 2004-02-09 10:54 ` konstantin at mysql dot com
  2004-02-14 20:40 ` [Bug debug/14079] " pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: konstantin at mysql dot com @ 2004-02-09 10:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From konstantin at mysql dot com  2004-02-09 10:54 -------
we checked 3.2.2 and it was OK

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14079


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug debug/14079] wrong debug info for extern boolean variable in debug mode
  2004-02-09 10:01 [Bug c++/14079] New: wrong debug info for extern boolean variable in debug mode gcc-bugzilla at gcc dot gnu dot org
  2004-02-09 10:54 ` [Bug c++/14079] " konstantin at mysql dot com
@ 2004-02-14 20:40 ` pinskia at gcc dot gnu dot org
  2004-02-15  0:25 ` [Bug debug/14079] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-14 20:40 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |debug


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14079


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug debug/14079] [3.3/3.4/3.5 Regression] wrong debug info for extern boolean variable in debug mode
  2004-02-09 10:01 [Bug c++/14079] New: wrong debug info for extern boolean variable in debug mode gcc-bugzilla at gcc dot gnu dot org
  2004-02-09 10:54 ` [Bug c++/14079] " konstantin at mysql dot com
  2004-02-14 20:40 ` [Bug debug/14079] " pinskia at gcc dot gnu dot org
@ 2004-02-15  0:25 ` pinskia at gcc dot gnu dot org
  2004-03-02  2:31 ` mmitchel at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-15  0:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-15 00:25 -------
Confirmed, foo is not being outputed at all in the debuging information.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |wrong-debug
      Known to fail|                            |3.3.1 3.4.0 3.5.0
      Known to work|                            |3.2.3
   Last reconfirmed|0000-00-00 00:00:00         |2004-02-15 00:25:20
               date|                            |
            Summary|wrong debug info for extern |[3.3/3.4/3.5 Regression]
                   |boolean variable in debug   |wrong debug info for extern
                   |mode                        |boolean variable in debug
                   |                            |mode
   Target Milestone|---                         |3.3.4


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14079


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug debug/14079] [3.3/3.4/3.5 Regression] wrong debug info for extern boolean variable in debug mode
  2004-02-09 10:01 [Bug c++/14079] New: wrong debug info for extern boolean variable in debug mode gcc-bugzilla at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-02-15  0:25 ` [Bug debug/14079] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-03-02  2:31 ` mmitchel at gcc dot gnu dot org
  2004-03-05 18:20 ` austern at apple dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-03-02  2:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-03-02 02:31 -------
Matt, this is coming from your static_decls optimization.  The problem is that
the variable in question is not ending up on the static_decls list when it is
first declared "extern".  It looks like your change works by adding things to
static_decls in add_decl_to_level.  I think that either you need to add "extern"
variables as well, or you need to notice the definition in duplicate_decls and
go back and fix up the static_decls list.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |austern at apple dot com
         AssignedTo|unassigned at gcc dot gnu   |austern at apple dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14079


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug debug/14079] [3.3/3.4/3.5 Regression] wrong debug info for extern boolean variable in debug mode
  2004-02-09 10:01 [Bug c++/14079] New: wrong debug info for extern boolean variable in debug mode gcc-bugzilla at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-03-02  2:31 ` mmitchel at gcc dot gnu dot org
@ 2004-03-05 18:20 ` austern at apple dot com
  2004-03-07  2:01 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: austern at apple dot com @ 2004-03-05 18:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From austern at apple dot com  2004-03-05 18:20 -------
I have a fix, which I've verified by hand-inspecting the assembly.  I'm a bit uncertain about whether to 
check in a test case, though.  The right test is either to put in a scan-assembler looking for the debug 
symbols or to run gdb and look for information about the variable in question.  However, it doesn't look 
like tests like that exist anywhere in our test suite.  It would be weird to invent a mechanism like that 
just for this one special case.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14079


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug debug/14079] [3.3/3.4/3.5 Regression] wrong debug info for extern boolean variable in debug mode
  2004-02-09 10:01 [Bug c++/14079] New: wrong debug info for extern boolean variable in debug mode gcc-bugzilla at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-03-05 18:20 ` austern at apple dot com
@ 2004-03-07  2:01 ` pinskia at gcc dot gnu dot org
  2004-03-08 19:03 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-07  2:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-07 02:01 -------
*** Bug 13276 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sdouglass at arm dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14079


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug debug/14079] [3.3/3.4/3.5 Regression] wrong debug info for extern boolean variable in debug mode
  2004-02-09 10:01 [Bug c++/14079] New: wrong debug info for extern boolean variable in debug mode gcc-bugzilla at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-03-07  2:01 ` pinskia at gcc dot gnu dot org
@ 2004-03-08 19:03 ` cvs-commit at gcc dot gnu dot org
  2004-03-08 19:30 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-03-08 19:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-03-08 19:03 -------
Subject: Bug 14079

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	austern@gcc.gnu.org	2004-03-08 19:03:15

Modified files:
	gcc/cp         : ChangeLog name-lookup.c 

Log message:
	PR debug/14079
	* name-lookup.c (add_decl_to_level): Add extern variables, as well as static, to static_decls array.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3985&r2=1.3986
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.c.diff?cvsroot=gcc&r1=1.42&r2=1.43



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14079


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug debug/14079] [3.3/3.4/3.5 Regression] wrong debug info for extern boolean variable in debug mode
  2004-02-09 10:01 [Bug c++/14079] New: wrong debug info for extern boolean variable in debug mode gcc-bugzilla at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2004-03-08 19:03 ` cvs-commit at gcc dot gnu dot org
@ 2004-03-08 19:30 ` cvs-commit at gcc dot gnu dot org
  2004-03-08 20:15 ` [Bug debug/14079] [3.3 " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-03-08 19:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-03-08 19:29 -------
Subject: Bug 14079

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	austern@gcc.gnu.org	2004-03-08 19:29:54

Modified files:
	gcc/cp         : ChangeLog name-lookup.c 

Log message:
	PR debug/14079
	* name-lookup.c (add_decl_to_level): Add extern variables, as well
	as static, to static_decls array.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.70&r2=1.3892.2.71
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.34.2.5&r2=1.34.2.6



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14079


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug debug/14079] [3.3 Regression] wrong debug info for extern boolean variable in debug mode
  2004-02-09 10:01 [Bug c++/14079] New: wrong debug info for extern boolean variable in debug mode gcc-bugzilla at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2004-03-08 19:30 ` cvs-commit at gcc dot gnu dot org
@ 2004-03-08 20:15 ` pinskia at gcc dot gnu dot org
  2004-03-17 21:52 ` cvs-commit at gcc dot gnu dot org
  2004-03-17 22:08 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-08 20:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-08 20:15 -------
Fixed for 3.4.0 and 3.5.0, still a 3.3.4 regression, please ask Gaby for approval.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[3.3/3.4/3.5 Regression]    |[3.3 Regression] wrong debug
                   |wrong debug info for extern |info for extern boolean
                   |boolean variable in debug   |variable in debug mode
                   |mode                        |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14079


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug debug/14079] [3.3 Regression] wrong debug info for extern boolean variable in debug mode
  2004-02-09 10:01 [Bug c++/14079] New: wrong debug info for extern boolean variable in debug mode gcc-bugzilla at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2004-03-08 20:15 ` [Bug debug/14079] [3.3 " pinskia at gcc dot gnu dot org
@ 2004-03-17 21:52 ` cvs-commit at gcc dot gnu dot org
  2004-03-17 22:08 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-03-17 21:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-03-17 21:52 -------
Subject: Bug 14079

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	austern@gcc.gnu.org	2004-03-17 21:52:17

Modified files:
	gcc/cp         : ChangeLog decl.c 

Log message:
	Backport:
	PR debug/14079
	* decl.c (add_decl_to_level): Add extern variables, as well
	as static, to static_decls array.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.263&r2=1.3076.2.264
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.965.2.79&r2=1.965.2.80



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14079


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug debug/14079] [3.3 Regression] wrong debug info for extern boolean variable in debug mode
  2004-02-09 10:01 [Bug c++/14079] New: wrong debug info for extern boolean variable in debug mode gcc-bugzilla at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2004-03-17 21:52 ` cvs-commit at gcc dot gnu dot org
@ 2004-03-17 22:08 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-17 22:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-17 22:08 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14079


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-03-17 22:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-09 10:01 [Bug c++/14079] New: wrong debug info for extern boolean variable in debug mode gcc-bugzilla at gcc dot gnu dot org
2004-02-09 10:54 ` [Bug c++/14079] " konstantin at mysql dot com
2004-02-14 20:40 ` [Bug debug/14079] " pinskia at gcc dot gnu dot org
2004-02-15  0:25 ` [Bug debug/14079] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
2004-03-02  2:31 ` mmitchel at gcc dot gnu dot org
2004-03-05 18:20 ` austern at apple dot com
2004-03-07  2:01 ` pinskia at gcc dot gnu dot org
2004-03-08 19:03 ` cvs-commit at gcc dot gnu dot org
2004-03-08 19:30 ` cvs-commit at gcc dot gnu dot org
2004-03-08 20:15 ` [Bug debug/14079] [3.3 " pinskia at gcc dot gnu dot org
2004-03-17 21:52 ` cvs-commit at gcc dot gnu dot org
2004-03-17 22:08 ` 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).