diff options
author | Jakub Jelinek <jakub@redhat.com> | 2015-01-28 21:30:30 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2015-01-28 21:30:30 +0100 |
commit | 13a48f378062cbd707063393613c44e17a18b71f (patch) | |
tree | 83d3087435763de99771071c43b7c2521a50dc82 | |
parent | 11c3a68e359dd7837a5f6b1d763c1b2aeebdd4de (diff) | |
download | gcc-13a48f378062cbd707063393613c44e17a18b71f.zip gcc-13a48f378062cbd707063393613c44e17a18b71f.tar.gz gcc-13a48f378062cbd707063393613c44e17a18b71f.tar.bz2 |
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<wide_int> instead of ggc_cleared_alloc<wide_int>.
(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
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 25 |
2 files changed, 26 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e39a383..d1ce2aac 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2015-01-28 Jakub Jelinek <jakub@redhat.com> + + PR other/63504 + * dwarf2out.c (add_AT_wide, mem_loc_descriptor, loc_descriptor): + Use ggc_alloc<wide_int> instead of ggc_cleared_alloc<wide_int>. + (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 <hubicka@ucw.cz> * varpool.c (tls_model_names): Fix names. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 1cafd52..d9b8c42 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<wide_int> (); + attr.dw_attr_val.v.val_wide = ggc_alloc<wide_int> (); *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<wide_int> (); + mem_loc_result->dw_loc_oprnd2.v.val_wide = ggc_alloc<wide_int> (); *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<wide_int> (); + loc_result->dw_loc_oprnd2.v.val_wide = ggc_alloc<wide_int> (); *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 (); |