diff mbox

[Ada] Fix -feliminate-unused-debug-types

Message ID 1750731.N5G8y8MPiU@polaris
State New
Headers show

Commit Message

Eric Botcazou May 18, 2014, 9:05 p.m. UTC
This was broken in Ada by recent callgraph/varpool changes.

Tested on x86_64-suse-linux, applied on the mainline and 4.9 branch.


2014-05-18  Eric Botcazou  <ebotcazou@adacore.com>

	* utils.c (gnat_write_global_declarations): Adjust the flags put on
	dummy_global.
diff mbox

Patch

Index: gcc-interface/utils.c
===================================================================
--- gcc-interface/utils.c	(revision 210579)
+++ gcc-interface/utils.c	(working copy)
@@ -5756,9 +5756,10 @@  gnat_write_global_declarations (void)
       dummy_global
 	= build_decl (BUILTINS_LOCATION, VAR_DECL, get_identifier (label),
 		      void_type_node);
+      DECL_HARD_REGISTER (dummy_global) = 1;
       TREE_STATIC (dummy_global) = 1;
-      TREE_ASM_WRITTEN (dummy_global) = 1;
       node = varpool_node_for_decl (dummy_global);
+      node->definition = 1;
       node->force_output = 1;
 
       while (!types_used_by_cur_var_decl->is_empty ())