utils.c (gnat_write_global_declarations): Make sure the dummy global built for global...
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 29 Feb 2012 11:41:07 +0000 (11:41 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 29 Feb 2012 11:41:07 +0000 (11:41 +0000)
* gcc-interface/utils.c (gnat_write_global_declarations): Make sure the
dummy global built for global types is preserved.

From-SVN: r184659

gcc/ada/ChangeLog
gcc/ada/gcc-interface/utils.c

index b0b51ee4f47f4296ec8ff54bf242cd33de561dc4..6303fb8e05f4f6c795b426868abdf5cc5bbad1c9 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-29  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc-interface/utils.c (gnat_write_global_declarations): Make sure the
+       dummy global built for global types is preserved.
+
 2012-02-27  Tristan Gingold  <gingold@adacore.com>
 
        * gcc-interface/decl.c (gnat_to_gnu_entity) [E_String_Type,
index 33d11ef3fe2c6f8a59fc9ac031a36a5d1242d901..ab405db814ef509c908ada2cbd1df712fbfc0152 100644 (file)
@@ -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))
        {