This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/35361] New: Missing dead store elimination for statics
- From: "xinliangli at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Feb 2008 05:23:51 -0000
- Subject: [Bug middle-end/35361] New: Missing dead store elimination for statics
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
// David Li
Gcc is solid in performing dead function elimination and dead variable
elimination for statics. It handles cases when a dead variable is referenced
(via initializer) by other dead variables pretty well. The missing
opportunities noticed is that it fails to discover dead stores to static
variables where are never used -- thus missing the dead variable elimination
...
Example 1:
static int s;
static int* p =&s;
int foo()
{
p = 0; // Dead, not eliminated
}
Example 2:
static int g = 10;
static int* gp = &g;
int foo()
{
gp = 0; // Dead store
return g; // should be const proped
}
--
Summary: Missing dead store elimination for statics
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: xinliangli at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35361