aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2000-08-28 19:07:55 -0400
committerJason Merrill <jason@gcc.gnu.org>2000-08-28 19:07:55 -0400
commit5de0e8d4e02cf79e31e9845aa03814306e9161c8 (patch)
treeb457276d26a916340a6292a7eacbe884f55e8917
parent04324727ebed1259ecede17a65c975fe656b5a5e (diff)
downloadgcc-5de0e8d4e02cf79e31e9845aa03814306e9161c8.zip
gcc-5de0e8d4e02cf79e31e9845aa03814306e9161c8.tar.gz
gcc-5de0e8d4e02cf79e31e9845aa03814306e9161c8.tar.bz2
dwarf2out.c (new_loc_descr): Use calloc.
* dwarf2out.c (new_loc_descr): Use calloc. (splice_child_die): Remove the die from the right parent. (gen_struct_or_union_die): Don't add AT_name to a specification DIE. From-SVN: r36021
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/dwarf2out.c10
2 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2d0bb76..885b563 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2000-08-28 Jason Merrill <jason@redhat.com>
+
+ * dwarf2out.c (new_loc_descr): Use calloc.
+ (splice_child_die): Remove the die from the right parent.
+ (gen_struct_or_union_die): Don't add AT_name to a specification DIE.
+
Mon Aug 28 19:02:13 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* toplev.c (decode_g_option): Don't give warning for unknown -g
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 11e9302..cc121e1 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -2470,10 +2470,11 @@ new_loc_descr (op, oprnd1, oprnd2)
register unsigned long oprnd1;
register unsigned long oprnd2;
{
+ /* Use xcalloc here so we clear out all of the long_long constant in
+ the union. */
register dw_loc_descr_ref descr
- = (dw_loc_descr_ref) xmalloc (sizeof (dw_loc_descr_node));
+ = (dw_loc_descr_ref) xcalloc (1, sizeof (dw_loc_descr_node));
- descr->dw_loc_next = NULL;
descr->dw_loc_opc = op;
descr->dw_loc_oprnd1.val_class = dw_val_class_unsigned_const;
descr->dw_loc_oprnd1.v.val_unsigned = oprnd1;
@@ -4649,7 +4650,7 @@ splice_child_die (parent, child)
&& child->die_parent != get_AT_ref (parent, DW_AT_specification))
abort ();
- for (p = &(parent->die_child); *p; p = &((*p)->die_sib))
+ for (p = &(child->die_parent->die_child); *p; p = &((*p)->die_sib))
if (*p == child)
{
*p = child->die_sib;
@@ -9185,9 +9186,10 @@ gen_struct_or_union_type_die (type, context_die)
? DW_TAG_structure_type : DW_TAG_union_type,
scope_die);
equate_type_number_to_die (type, type_die);
- add_name_attribute (type_die, type_tag (type));
if (old_die)
add_AT_die_ref (type_die, DW_AT_specification, old_die);
+ else
+ add_name_attribute (type_die, type_tag (type));
}
else
remove_AT (type_die, DW_AT_declaration);