summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-12-04 13:22:31 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-12-04 13:22:31 +0000
commit7b48bf2011b4020c4a5a2d5d4149b03983f72cc2 (patch)
treeb07a064ee6bddbe6ddf73a98a9c131b5ab6a0f5f /gcc/dwarf2out.c
parent8cd167a5ad8baf4988e07fcbc9c9cc338c02d3d1 (diff)
downloadgcc-tarball-7b48bf2011b4020c4a5a2d5d4149b03983f72cc2.tar.gz
gcc-5.3.0gcc-5.3.0
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c19
1 files changed, 13 insertions, 6 deletions
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: