https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51726
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org Component|lto |target --- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- On trunk the backend has to use varpool_node::get (decl)->get_constructor (). But seriously the backend should process the attribute once at compile-time and then discard it rather than trying to re-do the job at WPA/LTRANS time. That is, _not_ do this in i386_pe_encode_section_info which is way too late but instead directly in ix86_handle_selectany_attribute so LTO can see the decl is one-only (and also the linker is informed correctly). Still completely a backend bug. IMHO as soon as it's not necessary to retain the attribute on the decl it's a sign of a good implementation.