http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51255
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Keywords| |wrong-code Last reconfirmed| |2012-03-06 Component|lto |middle-end CC| |hubicka at gcc dot gnu.org, | |rguenth at gcc dot gnu.org Ever Confirmed|0 |1 Summary|Using -flto breaks code |Using -fwhole-program |which puts values in .ctors |breaks code which puts |or .init_array |values in .ctors or | |.init_array --- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-06 10:25:53 UTC --- Reproducible with -O -fwhole-program as well. This is IPA references work which does not recognize count as being written to which is because we removed the .init/fini_array section contents. If you mark the section contents with the 'used' attribute it works correctly. Honza, can we apply some magic here? Thus, recognize special section names or so? Or is this a user bug (with -fwhole-program)? Note that the linker plugin gets this wrong as well (somehow).