public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14167] New: Unneeded C++ types are output in debug info due to use of static constants
@ 2004-02-17 4:50 drow at gcc dot gnu dot org
2004-02-17 5:07 ` [Bug c++/14167] " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: drow at gcc dot gnu dot org @ 2004-02-17 4:50 UTC (permalink / raw)
To: gcc-bugs
Take this testcase:
class Class1 {
static const int var1 = 1;
static const int var2 = var1;
};
class Class2 {
static const int var1 = 1;
static const int var2 = 1;
};
Compile it with -gdwarf-2. Debug information for Class2 will not be emitted,
which is OK, because Class2 is unused. Debug information for Class1 will be
emitted, because Class1::var1 is marked as used in the initializer for Class1::var2,
which causes Class1::var1 to be emitted, which causes all of Class1 to be emitted.
It gets marked used in finish_id_expression as I expected:
2581 if (TREE_CODE (decl) == VAR_DECL
2582 || TREE_CODE (decl) == PARM_DECL
2583 || TREE_CODE (decl) == RESULT_DECL)
2584 mark_used (decl);
Is the used marker necessary in integral constant-expressions? Where else?
This is the source of about 60% of the (60k!) debug information emitted for the
"trivial" C++ program:
#include <iostream>
int main() { return 0; }
--
Summary: Unneeded C++ types are output in debug info due to use
of static constants
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: drow at gcc dot gnu dot org
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=14167
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/14167] Unneeded C++ types are output in debug info due to use of static constants
2004-02-17 4:50 [Bug c++/14167] New: Unneeded C++ types are output in debug info due to use of static constants drow at gcc dot gnu dot org
@ 2004-02-17 5:07 ` pinskia at gcc dot gnu dot org
2004-08-11 22:10 ` pinskia at gcc dot gnu dot org
2005-05-12 2:06 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-17 5:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-02-17 05:07 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-02-17 05:07:39
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14167
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/14167] Unneeded C++ types are output in debug info due to use of static constants
2004-02-17 4:50 [Bug c++/14167] New: Unneeded C++ types are output in debug info due to use of static constants drow at gcc dot gnu dot org
2004-02-17 5:07 ` [Bug c++/14167] " pinskia at gcc dot gnu dot org
@ 2004-08-11 22:10 ` pinskia at gcc dot gnu dot org
2005-05-12 2:06 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-11 22:10 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Last reconfirmed|2004-05-19 19:59:32 |2004-08-11 22:09:57
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14167
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/14167] Unneeded C++ types are output in debug info due to use of static constants
2004-02-17 4:50 [Bug c++/14167] New: Unneeded C++ types are output in debug info due to use of static constants drow at gcc dot gnu dot org
2004-02-17 5:07 ` [Bug c++/14167] " pinskia at gcc dot gnu dot org
2004-08-11 22:10 ` pinskia at gcc dot gnu dot org
@ 2005-05-12 2:06 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-12 2:06 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-12 02:06 -------
I think this has now been fixed (I tried to reproduce this with the testcase but I don't know if I did the
correct thing to check).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14167
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-05-12 2:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-17 4:50 [Bug c++/14167] New: Unneeded C++ types are output in debug info due to use of static constants drow at gcc dot gnu dot org
2004-02-17 5:07 ` [Bug c++/14167] " pinskia at gcc dot gnu dot org
2004-08-11 22:10 ` pinskia at gcc dot gnu dot org
2005-05-12 2:06 ` 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).