https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89886
--- Comment #2 from vfdff <zhongyunde at huawei dot com> --- it was worked in function varpool_node::finalize_decl (tree decl) /* Set definition first before calling notice_global_symbol so that it is available to notice_global_symbol. */ node->definition = true; notice_global_symbol (decl); if (TREE_THIS_VOLATILE (decl) || TREE_DESTRUCTIVE (decl) || DECL_PRESERVE_P (decl) /* Traditionally we do not eliminate static variables when not optimizing and when not doing toplevel reoder. */ || node->no_reorder || ((!flag_toplevel_reorder && !DECL_COMDAT (node->decl) && !DECL_ARTIFICIAL (node->decl)))) node->force_output = true;