This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22355] New: Multiple local static variables initialization: missed optimization opportunity
- From: "yuri at tsoft dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jul 2005 20:29:03 -0000
- Subject: [Bug c++/22355] New: Multiple local static variables initialization: missed optimization opportunity
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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