]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR debug/16261 (ICE: output_die, at dwarf2out.c:6628)
authorEric Botcazou <ebotcazou@libertysurf.fr>
Tue, 18 Jan 2005 21:39:38 +0000 (22:39 +0100)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 18 Jan 2005 21:39:38 +0000 (21:39 +0000)
PR debug/16261
Backport from mainline:
2004-01-27  Devang Patel  <dpatel@apple.com>

* dwarf2out.c: (remove_child_TAG): New function.
(gen_subprogram_die): Do not remove all children dies while reusing
declaration die for definition.  Instead, selectively remove only
formal parameters.

From-SVN: r93855

gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog

index b18fc1fece776ab43f1d8a1f294cf13fe6b653cc..6eaafd01c7beb5e5ced2068b73778b1cb25590f5 100644 (file)
@@ -1,3 +1,14 @@
+2005-01-18  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR debug/16261
+       Backport from mainline:
+       2004-01-27  Devang Patel  <dpatel@apple.com>
+        
+       * dwarf2out.c: (remove_child_TAG): New function.
+       (gen_subprogram_die): Do not remove all children dies while reusing
+       declaration die for definition.  Instead, selectively remove only
+       formal parameters.
+
 2005-01-18  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        PR rtl-optimization/19296
index 651d22909f9956cc73303fd5020f6acf8c121b1a..9416023c57620fb2489d6a2b8a490da827340a9a 100644 (file)
@@ -3649,6 +3649,7 @@ static bool is_java (void);
 static bool is_fortran (void);
 static bool is_ada (void);
 static void remove_AT (dw_die_ref, enum dwarf_attribute);
+static void remove_child_TAG (dw_die_ref, enum dwarf_tag);
 static inline void free_die (dw_die_ref);
 static void remove_children (dw_die_ref);
 static void add_child_die (dw_die_ref, dw_die_ref);
@@ -5055,6 +5056,34 @@ remove_AT (dw_die_ref die, enum dwarf_attribute attr_kind)
     }
 }
 
+/* Remove child die whose die_tag is specified tag.  */
+
+static void
+remove_child_TAG (dw_die_ref die, enum dwarf_tag tag)
+{
+  dw_die_ref current, prev, next;
+  current = die->die_child;
+  prev = NULL;
+  while (current != NULL)
+    {
+      if (current->die_tag == tag)
+       {
+         next = current->die_sib;
+         if (prev == NULL)
+           die->die_child = next;
+         else
+           prev->die_sib = next;
+         free_die (current);
+         current = next;
+       }
+      else
+       {
+         prev = current;
+         current = current->die_sib;
+       }
+    }
+}
+
 /* Free up the memory used by DIE.  */
 
 static inline void
@@ -10872,9 +10901,9 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
        {
          subr_die = old_die;
 
-         /* Clear out the declaration attribute and the parm types.  */
+         /* Clear out the declaration attribute and the formal parameters.  */
          remove_AT (subr_die, DW_AT_declaration);
-         remove_children (subr_die);
+         remove_child_TAG (subr_die, DW_TAG_formal_parameter);
        }
       else
        {
index 45cc65f50467df3bc968ddeb06235b31c2f7a2b0..9df14f7c95c0fbea972595477315d3d195332cc6 100644 (file)
@@ -1,3 +1,7 @@
+2005-01-18  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * g++.dg/debug/typedef3.C: New test.
+
 2005-01-18  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        * gcc.dg/short-compare-1.c: New test.