[debug-early] Disable removal of DW_tags* while generating subprogram DIEs
diff mbox

Message ID 541C5E79.7060200@redhat.com
State New
Headers show

Commit Message

Aldy Hernandez Sept. 19, 2014, 4:48 p.m. UTC
On 09/18/14 13:55, Jason Merrill wrote:
> On 09/18/2014 03:25 PM, Aldy Hernandez wrote:
>> This patch disables removing of
>> DW_AT_{declaration,object_pointer,formal_parameter} tags while
>> generating a DIE for subprograms.  Now that we generate dwarf info
>> early, we will always have an old_die the second time around.   I see no
>> need to remove the aforementioned tags, only to create them again
>> (incorrectly in a C++ testcase I have).
>
> I think you probably still want to remove DW_AT_declaration, as you
> probably don't want it the second time around (and wouldn't create it
> again).

Sounds good to me.

Applied the attached patch.

Thanks.
commit b033487ef30cf7b81edb8cd8346f874ec78e0b20
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Fri Sep 19 10:46:54 2014 -0600

    	* dwarf2out.c (gen_subprogram_die): Remove DW_AT_declaration even
    	if we have an old die.

Patch
diff mbox

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 68b4650..48b1106 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -18310,6 +18310,10 @@  gen_subprogram_die (tree decl, dw_die_ref context_die)
 	  remove_AT (subr_die, DW_AT_declaration);
 	  remove_AT (subr_die, DW_AT_object_pointer);
 	  remove_child_TAG (subr_die, DW_TAG_formal_parameter);
+#else
+	  /* We don't need the DW_AT_declaration the second or third
+	     time around anyhow.  */
+	  remove_AT (subr_die, DW_AT_declaration);
 #endif
 	}
       else