public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/35361]  New: Missing dead store elimination for statics
@ 2008-02-25  5:24 xinliangli at gmail dot com
  2008-02-25 11:40 ` [Bug middle-end/35361] Missing IPA DCE and DSE rguenth at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: xinliangli at gmail dot com @ 2008-02-25  5:24 UTC (permalink / raw)
  To: gcc-bugs

// 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


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

* [Bug middle-end/35361] Missing IPA DCE and DSE
  2008-02-25  5:24 [Bug middle-end/35361] New: Missing dead store elimination for statics xinliangli at gmail dot com
@ 2008-02-25 11:40 ` rguenth at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-25 11:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2008-02-25 11:39 -------
It looks like this needs IPA DCE/DSE.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |missed-optimization
   Last reconfirmed|0000-00-00 00:00:00         |2008-02-25 11:39:30
               date|                            |
            Summary|Missing dead store          |Missing IPA DCE and DSE
                   |elimination for statics     |
            Version|unknown                     |4.3.0


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


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

end of thread, other threads:[~2008-02-25 11:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-25  5:24 [Bug middle-end/35361] New: Missing dead store elimination for statics xinliangli at gmail dot com
2008-02-25 11:40 ` [Bug middle-end/35361] Missing IPA DCE and DSE rguenth 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).