https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51255
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> --- With the used attribute added to each of the variables, the code starts working with both -flto and -fwhole-program (even on clang/LLVM this is needed to work correctly). So closing as invalid.