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/29850] .ctor does not work with optimization levels -O2, -O3 and -O4



------- 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


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