public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix early late DWARF generation
@ 2016-08-25  9:25 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2016-08-25  9:25 UTC (permalink / raw)
  To: gcc-patches


This fixes a recent regression where we generate symbolic locations while
early DWARF is still in effect.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2016-08-25  Richard Biener  <rguenther@suse.de>

	* dwarf2out.c (gen_remaining_tmpl_value_param_die_attributes):
	Only add locations in late dwarf.
	(gen_scheduled_generic_parms_dies): Do not set early dwarf here.
	(dwarf2out_early_finish): But do it here.

Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c	(revision 239735)
+++ gcc/dwarf2out.c	(working copy)
@@ -24410,7 +24410,8 @@ gen_remaining_tmpl_value_param_die_attri
 	  if (!tree_add_const_value_attribute (e->die, e->arg))
 	    {
 	      dw_loc_descr_ref loc = NULL;
-	      if (dwarf_version >= 5 || !dwarf_strict)
+	      if (! early_dwarf
+		  && (dwarf_version >= 5 || !dwarf_strict))
 		loc = loc_descriptor_from_tree (e->arg, 2, NULL);
 	      if (loc)
 		add_AT_loc (e->die, DW_AT_location, loc);
@@ -24436,10 +24437,6 @@ gen_scheduled_generic_parms_dies (void)
   if (!generic_type_instances)
     return;
   
-  /* We end up "recursing" into schedule_generic_params_dies_gen, so
-     pretend this generation is part of "early dwarf" as well.  */
-  set_early_dwarf s;
-
   FOR_EACH_VEC_ELT (*generic_type_instances, i, t)
     if (COMPLETE_TYPE_P (t))
       gen_generic_params_dies (t);
@@ -28137,6 +28134,8 @@ dwarf2out_finish (const char *filename)
 static void
 dwarf2out_early_finish (void)
 {
+  set_early_dwarf s;
+
   /* Walk through the list of incomplete types again, trying once more to
      emit full debugging info for them.  */
   retry_incomplete_types ();

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-25  9:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-25  9:25 [PATCH] Fix early late DWARF generation Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).