This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/4131] The C++ compiler doesn't place a const class object to ".rodata" section with non trivial constructor


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4131

--- Comment #32 from Jason Merrill <jason at gcc dot gnu.org> ---
As previously pointed out, since GCC 4.7, for many classes this is a simple
matter of adding "constexpr" to the constructor.

With the testcase for bug 84103, I notice that clang does dynamic
initialization at -O0 and static initialization at -O1.  We could do something
similar: if the optimizers know the value of a variable at the end of a global
initialization function, they could put that value into that variable
statically instead.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]