This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] fix -feliminate-unused-debug-types counter-measure


-feliminate-unused-debug-types will be enabled for Ada as well in GCC 4.7 and 
we have implemented a counter-measure to be able to retain apparently unused 
types in a few specific cases.  But it was inadvertently broken some time ago.

Fixed thusly, tested on i586-suse-linux, applied on the mainline.


I'd like to also apply the following patch:
  http://gcc.gnu.org/ml/gcc-patches/2012-02/msg01349.html
which fixes debug info regressions introduced by the simultaneous introduction 
of DW_AT_GNAT_descriptive_type and -feliminate-unused-debug-types in Ada.  It 
only affects the Ada compiler since only GNAT uses DW_AT_GNAT_descriptive_type 
and sets TYPE_ARTIFICIAL on its types.  OK?


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.


-- 
Eric Botcazou
Index: gcc-interface/utils.c
===================================================================
--- gcc-interface/utils.c	(revision 211857)
+++ gcc-interface/utils.c	(revision 211858)
@@ -4895,11 +4895,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))
 	{

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]