https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53932
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- So, the problem is that build_anon_union_vars builds artificial variables for the anon union members and they those VAR_DECLs have DECL_VALUE_EXPR set to the D.2763.i and similar COMPONENT_REFs. But VAR_DECLs with DECL_VALUE_EXPRs are only actually replaced with those DECL_VALUE_EXPR expressions during gimplification or regimplification (which explains why it works fine inside of code in functions or global constructors). Nothing replaces them in DECL_INITIAL expressions of statically initialized vars.