From 35e8bcf454d87488314530a6b8b3ab515c587de3 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 29 Feb 2012 11:41:07 +0000 Subject: utils.c (gnat_write_global_declarations): Make sure the dummy global built for global types is preserved. * gcc-interface/utils.c (gnat_write_global_declarations): Make sure the dummy global built for global types is preserved. From-SVN: r184659 --- gcc/ada/gcc-interface/utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/ada/gcc-interface/utils.c') diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 33d11ef..ab405db 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -4892,11 +4892,14 @@ gnat_write_global_declarations (void) the global hash table. We use a dummy variable for this purpose. */ if (!VEC_empty (tree, types_used_by_cur_var_decl)) { + struct varpool_node *node; dummy_global = build_decl (BUILTINS_LOCATION, VAR_DECL, NULL_TREE, void_type_node); TREE_STATIC (dummy_global) = 1; TREE_ASM_WRITTEN (dummy_global) = 1; - varpool_mark_needed_node (varpool_node (dummy_global)); + node = varpool_node (dummy_global); + node->force_output = 1; + varpool_mark_needed_node (node); while (!VEC_empty (tree, types_used_by_cur_var_decl)) { -- cgit v1.1