This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/29850] .ctor does not work with optimization levels -O2, -O3 and -O4
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Nov 2006 21:45:45 -0000
- Subject: [Bug c/29850] .ctor does not work with optimization levels -O2, -O3 and -O4
- References: <bug-29850-13571@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-11-15 21:45 -------
static char *__g_data_init_f=(char *)__G_DATA_INIT;
static void __G_DATA_CTOR() {
asm(".section .ctors");
asm(".long __G_DATA_INIT");
asm(".section .text ");
}
Since both __g_data_init_f and __G_DATA_CTOR are unused, they get removed.
Your code is invalid and should be changed to use the attrubute constructor (on
__G_DATA_INIT) instead.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29850