OSDN Git Service

* gcc-interface/utils.c (gnat_write_global_declarations): Make sure the
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Feb 2012 11:41:07 +0000 (11:41 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Feb 2012 11:41:07 +0000 (11:41 +0000)
dummy global built for global types is preserved.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184659 138bc75d-0d04-0410-961f-82ee72b054a4

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

index b0b51ee..6303fb8 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 33d11ef..ab405db 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))
        {