Commit 35e8bcf4 by Eric Botcazou Committed by Eric Botcazou

utils.c (gnat_write_global_declarations): Make sure the dummy global built for…

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
parent 1edaa8b7
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> 2012-02-27 Tristan Gingold <gingold@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) [E_String_Type, * gcc-interface/decl.c (gnat_to_gnu_entity) [E_String_Type,
......
...@@ -4892,11 +4892,14 @@ gnat_write_global_declarations (void) ...@@ -4892,11 +4892,14 @@ gnat_write_global_declarations (void)
the global hash table. We use a dummy variable for this purpose. */ the global hash table. We use a dummy variable for this purpose. */
if (!VEC_empty (tree, types_used_by_cur_var_decl)) if (!VEC_empty (tree, types_used_by_cur_var_decl))
{ {
struct varpool_node *node;
dummy_global dummy_global
= build_decl (BUILTINS_LOCATION, VAR_DECL, NULL_TREE, void_type_node); = build_decl (BUILTINS_LOCATION, VAR_DECL, NULL_TREE, void_type_node);
TREE_STATIC (dummy_global) = 1; TREE_STATIC (dummy_global) = 1;
TREE_ASM_WRITTEN (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)) while (!VEC_empty (tree, types_used_by_cur_var_decl))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment