===================================================================
@@ -2486,6 +2486,10 @@ finish_compound_literal (tree type, tree compound_
decl = pushdecl_top_level (decl);
DECL_NAME (decl) = make_anon_name ();
SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl));
+ /* Capture the current module info for statics. */
+ if (L_IPO_COMP_MODE)
+ varpool_node_for_decl (decl);
+
return decl;
}
else
===================================================================
@@ -9047,6 +9047,9 @@ make_temporary_var_for_ref_to_temp (tree decl, tre
tree name;
TREE_STATIC (var) = TREE_STATIC (decl);
+ /* Capture the current module info for statics. */
+ if (L_IPO_COMP_MODE && TREE_STATIC (var))
+ varpool_node_for_decl (var);
DECL_TLS_MODEL (var) = DECL_TLS_MODEL (decl);
name = mangle_ref_init_variable (decl);
DECL_NAME (var) = name;