public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/45307]  New: Stores expanding to no RTL not removed by tree optimizers, Empty ctors/dtors not eliminated
@ 2010-08-17 12:37 hubicka at gcc dot gnu dot org
  2010-08-17 12:38 ` [Bug middle-end/45307] " hubicka at gcc dot gnu dot org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2010-08-17 12:37 UTC (permalink / raw)
  To: gcc-bugs

Compilling:
 ./g++ -O2 ~/mozalloc.ii  -S -m32
gives me:
        .type   _GLOBAL__I_moz_free, @function
_GLOBAL__I_moz_free:
.LFB58:
        .cfi_startproc
        rep
        ret
        .cfi_endproc
.LFE58:
        .size   _GLOBAL__I_moz_free, .-_GLOBAL__I_moz_free
        .section        .ctors,"aw",@progbits
        .align 4
        .long   _GLOBAL__I_moz_free
        .local  _ZN7mozillaL8fallibleE
        .comm   _ZN7mozillaL8fallibleE,1,1

I.e. an empty constructor function that can be eliminated and also 
local var   _ZN7mozillaL8fallibleE that is not used at all.
The reason is that constructor in .optimized stage looks like:
(static initializers for /mozilla-central/memory/mozalloc/mozalloc.cpp) ()
{
<bb 2>:
  fallible = {};
  return;

}

that later expands to nothing.  If we optimized this away during early opts I
already have patch that makes it easy to eliminate all global ctors/dtors that
are known to be pure.

Honza


-- 
           Summary: Stores expanding to no RTL not removed by tree
                    optimizers, Empty ctors/dtors not eliminated
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hubicka at gcc dot gnu dot org


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


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

end of thread, other threads:[~2010-08-21  9:48 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-17 12:37 [Bug middle-end/45307] New: Stores expanding to no RTL not removed by tree optimizers, Empty ctors/dtors not eliminated hubicka at gcc dot gnu dot org
2010-08-17 12:38 ` [Bug middle-end/45307] " hubicka at gcc dot gnu dot org
2010-08-17 12:49 ` [Bug c++/45307] " rguenth at gcc dot gnu dot org
2010-08-17 13:34 ` [Bug middle-end/45307] " hubicka at gcc dot gnu dot org
2010-08-17 14:42 ` mmitchel at gcc dot gnu dot org
2010-08-17 15:58 ` rguenth at gcc dot gnu dot org
2010-08-17 16:43 ` hubicka at gcc dot gnu dot org
2010-08-17 16:46 ` hubicka at gcc dot gnu dot org
2010-08-17 16:54 ` jakub at gcc dot gnu dot org
2010-08-17 17:41 ` jason at gcc dot gnu dot org
2010-08-17 17:51 ` mmitchel at gcc dot gnu dot org
2010-08-17 18:09 ` jason at gcc dot gnu dot org
2010-08-17 18:18 ` jason at gcc dot gnu dot org
2010-08-19 17:01 ` jason at gcc dot gnu dot org
2010-08-20 10:23 ` hubicka at gcc dot gnu dot org
2010-08-21  9:46 ` hubicka at gcc dot gnu dot org
2010-08-21  9:48 ` hubicka 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).