From 7b48bf2011b4020c4a5a2d5d4149b03983f72cc2 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Fri, 4 Dec 2015 13:22:31 +0000 Subject: gcc-5.3.0 --- gcc/dwarf2out.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'gcc/dwarf2out.c') diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 749d4cea46..3614c10780 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -389,12 +389,14 @@ dump_struct_debug (tree type, enum debug_info_usage usage, #endif /* Get the number of HOST_WIDE_INTs needed to represent the precision - of the number. */ + of the number. Some constants have a large uniform precision, so + we get the precision needed for the actual value of the number. */ static unsigned int get_full_len (const wide_int &op) { - return ((op.get_precision () + HOST_BITS_PER_WIDE_INT - 1) + int prec = wi::min_precision (op, UNSIGNED); + return ((prec + HOST_BITS_PER_WIDE_INT - 1) / HOST_BITS_PER_WIDE_INT); } @@ -8901,14 +8903,14 @@ output_die (dw_die_ref die) { dw2_asm_output_data (l, a->dw_attr_val.v.val_wide->elt (i), "%s", name); - name = NULL; + name = ""; } else for (i = 0; i < len; ++i) { dw2_asm_output_data (l, a->dw_attr_val.v.val_wide->elt (i), "%s", name); - name = NULL; + name = ""; } } break; @@ -15470,8 +15472,13 @@ add_const_value_attribute (dw_die_ref die, rtx rtl) return true; case CONST_WIDE_INT: - add_AT_wide (die, DW_AT_const_value, - std::make_pair (rtl, GET_MODE (rtl))); + { + wide_int w1 = std::make_pair (rtl, MAX_MODE_INT); + unsigned int prec = MIN (wi::min_precision (w1, UNSIGNED), + (unsigned int)CONST_WIDE_INT_NUNITS (rtl) * HOST_BITS_PER_WIDE_INT); + wide_int w = wi::zext (w1, prec); + add_AT_wide (die, DW_AT_const_value, w); + } return true; case CONST_DOUBLE: -- cgit v1.2.1