From: Jakub Jelinek Date: Wed, 28 Jan 2015 20:30:30 +0000 (+0100) Subject: re PR other/63504 (Issues found by --enable-checking=valgrind) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=13a48f378062cbd707063393613c44e17a18b71f;p=gcc.git re PR other/63504 (Issues found by --enable-checking=valgrind) PR other/63504 * dwarf2out.c (add_AT_wide, mem_loc_descriptor, loc_descriptor): Use ggc_alloc instead of ggc_cleared_alloc. (attr_checksum, attr_checksum_ordered, hash_loc_operands): Checksum only get_full_len HOST_WIDE_INTs from get_val () array rather than all bits in *val_wide. From-SVN: r220216 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e39a38376a7..d1ce2aac2f8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2015-01-28 Jakub Jelinek + + PR other/63504 + * dwarf2out.c (add_AT_wide, mem_loc_descriptor, loc_descriptor): + Use ggc_alloc instead of ggc_cleared_alloc. + (attr_checksum, attr_checksum_ordered, hash_loc_operands): Checksum + only get_full_len HOST_WIDE_INTs from get_val () array rather than + all bits in *val_wide. + 2015-01-28 Jan Hubicka * varpool.c (tls_model_names): Fix names. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 1cafd52bf00..d9b8c421898 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -3886,7 +3886,7 @@ add_AT_wide (dw_die_ref die, enum dwarf_attribute attr_kind, attr.dw_attr = attr_kind; attr.dw_attr_val.val_class = dw_val_class_wide_int; - attr.dw_attr_val.v.val_wide = ggc_cleared_alloc (); + attr.dw_attr_val.v.val_wide = ggc_alloc (); *attr.dw_attr_val.v.val_wide = w; add_dwarf_attr (die, &attr); } @@ -5726,7 +5726,9 @@ attr_checksum (dw_attr_ref at, struct md5_ctx *ctx, int *mark) CHECKSUM (at->dw_attr_val.v.val_double); break; case dw_val_class_wide_int: - CHECKSUM (*at->dw_attr_val.v.val_wide); + CHECKSUM_BLOCK (at->dw_attr_val.v.val_wide->get_val (), + get_full_len (*at->dw_attr_val.v.val_wide) + * HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR); break; case dw_val_class_vec: CHECKSUM_BLOCK (at->dw_attr_val.v.val_vec.array, @@ -6009,8 +6011,11 @@ attr_checksum_ordered (enum dwarf_tag tag, dw_attr_ref at, case dw_val_class_wide_int: CHECKSUM_ULEB128 (DW_FORM_block); - CHECKSUM_ULEB128 (sizeof (*at->dw_attr_val.v.val_wide)); - CHECKSUM (*at->dw_attr_val.v.val_wide); + CHECKSUM_ULEB128 (get_full_len (*at->dw_attr_val.v.val_wide) + * HOST_BITS_PER_WIDE_INT / BITS_PER_UNIT); + CHECKSUM_BLOCK (at->dw_attr_val.v.val_wide->get_val (), + get_full_len (*at->dw_attr_val.v.val_wide) + * HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR); break; case dw_val_class_vec: @@ -13160,7 +13165,7 @@ mem_loc_descriptor (rtx rtl, machine_mode mode, mem_loc_result->dw_loc_oprnd1.v.val_die_ref.external = 0; mem_loc_result->dw_loc_oprnd2.val_class = dw_val_class_wide_int; - mem_loc_result->dw_loc_oprnd2.v.val_wide = ggc_cleared_alloc (); + mem_loc_result->dw_loc_oprnd2.v.val_wide = ggc_alloc (); *mem_loc_result->dw_loc_oprnd2.v.val_wide = std::make_pair (rtl, mode); } break; @@ -13663,7 +13668,7 @@ loc_descriptor (rtx rtl, machine_mode mode, loc_result = new_loc_descr (DW_OP_implicit_value, GET_MODE_SIZE (mode), 0); loc_result->dw_loc_oprnd2.val_class = dw_val_class_wide_int; - loc_result->dw_loc_oprnd2.v.val_wide = ggc_cleared_alloc (); + loc_result->dw_loc_oprnd2.v.val_wide = ggc_alloc (); *loc_result->dw_loc_oprnd2.v.val_wide = std::make_pair (rtl, mode); } break; @@ -24022,7 +24027,9 @@ hash_loc_operands (dw_loc_descr_ref loc, inchash::hash &hstate) hstate.add_object (val2->v.val_double.high); break; case dw_val_class_wide_int: - hstate.add_object (*val2->v.val_wide); + hstate.add (val2->v.val_wide->get_val (), + get_full_len (*val2->v.val_wide) + * HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR); break; case dw_val_class_addr: inchash::add_rtx (val2->v.val_addr, hstate); @@ -24113,7 +24120,9 @@ hash_loc_operands (dw_loc_descr_ref loc, inchash::hash &hstate) hstate.add_object (val2->v.val_double.high); break; case dw_val_class_wide_int: - hstate.add_object (*val2->v.val_wide); + hstate.add (val2->v.val_wide->get_val (), + get_full_len (*val2->v.val_wide) + * HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR); break; default: gcc_unreachable ();