public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/22355] New: Multiple local static variables initialization: missed optimization opportunity
@ 2005-07-07 20:29 yuri at tsoft dot com
  2005-07-07 20:39 ` [Bug c++/22355] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: yuri at tsoft dot com @ 2005-07-07 20:29 UTC (permalink / raw)
  To: gcc-bugs

Following code (f()) if compiled with -fno-exceptions should
produce only one initialization boolean for all local
static variables, not one per variable. This is since
they always initialized together provided there are no exceptions.

If exceptions are allowed then it should be driven by
the flag in constructors saying if they allow exceptions or not.

Yuri

---------------------------
struct C {
  C();
  int get();
};


int f() {
  static C i;
  static C j;
  return (i.get() + j.get());
}

-- 
           Summary: Multiple local static variables initialization: missed
                    optimization opportunity
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yuri at tsoft dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-07-07 22:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-07 20:29 [Bug c++/22355] New: Multiple local static variables initialization: missed optimization opportunity yuri at tsoft dot com
2005-07-07 20:39 ` [Bug c++/22355] " pinskia at gcc dot gnu dot org
2005-07-07 20:52 ` giovannibajo at libero dot it
2005-07-07 21:21 ` yuri at Magma-DA dot COM
2005-07-07 22:14 ` bangerth at dealii 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).