This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ping] Fix PR debug/66728
- From: Mike Stump <mikestump at comcast dot net>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Richard Sandiford <richard dot sandiford at arm dot com>, Bernd Schmidt <bschmidt at redhat dot com>, Ulrich Weigand <uweigand at de dot ibm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 5 Nov 2015 17:34:54 -0800
- Subject: Re: [ping] Fix PR debug/66728
- Authentication-results: sourceware.org; auth=none
- References: <20151028115839 dot 1E7C85C3D at oc7340732750 dot ibm dot com> <87ziz3ta4t dot fsf at e105548-lin dot cambridge dot arm dot com> <5630D8AE dot 1090608 at redhat dot com> <87h9l4v2pi dot fsf at e105548-lin dot cambridge dot arm dot com> <87611kuzz4 dot fsf at e105548-lin dot cambridge dot arm dot com> <D9850ADD-F2B9-4B3E-8DD9-DF8FEB2E9C36 at comcast dot net> <871tc8unnx dot fsf at e105548-lin dot cambridge dot arm dot com> <A6732F72-4484-45B8-8232-7B5BF8DE4949 at comcast dot net> <87wptztqpx dot fsf at e105548-lin dot cambridge dot arm dot com> <29C8CB44-A0EC-4A9A-A4D3-3ABB6D66DA5B at comcast dot net> <CAFiYyc18ZRYXJRPYpU0W2vCf8NZQcd8MngHgUb9ggu8HxZ1NKg at mail dot gmail dot com> <7ADD4B03-BF3E-48BA-8028-AC5EB50E773C at comcast dot net> <CAFiYyc2DwthVCAk2TPcTnJOWyCjiuQFGXHKFw08MTNpzGPa9ug at mail dot gmail dot com> <8AEB7496-7440-4239-95E9-272C6EF2AB70 at comcast dot net> <87mvuttrnz dot fsf at e105548-lin dot cambridge dot arm dot com> <721A5B44-82AC-4D72-9E50-500D5E5A7EC5 at comcast dot net> <CAFiYyc1Cx4oV217zo3Z-+Hb779mqPA7mPecWJ1mLy4ziMrW9SQ at mail dot gmail dot com>
On Nov 5, 2015, at 4:32 AM, Richard Biener <richard.guenther@gmail.com> wrote:
> No idea on location lists but maybe this means we should just use the
> maximum supported integer mode for CONST_WIDE_INTs?
Ah, yeah, that sounds like a fine idea. Below is that version. I snuck in one more change, as it was annoying me, and it is a regression from gcc-4.8. It has this effect:
@@ -55,7 +55,7 @@ test:
.long 0x72 # DW_AT_type
.byte 0x10
.quad 0 # DW_AT_const_value
- .quad 0x8000000000000000 # (null)
+ .quad 0x8000000000000000 #
.byte 0 # end of children of DIE 0x2d
.uleb128 0x4 # (DIE (0x6b) DW_TAG_base_type)
.byte 0x10 # DW_AT_byte_size
This version has the added benefit of reducing all wide_ints to be so shortened. We do this by changing get_full_len, which changes the world.
If there are no substantial reasons to not check it in now, I’d like to proceed and get it checked in. People can refine it further in tree if they want. Any objections?
Index: dwarf2out.c
===================================================================
--- dwarf2out.c (revision 229720)
+++ dwarf2out.c (working copy)
@@ -368,12 +368,14 @@
#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);
}
@@ -9010,7 +9012,7 @@
{
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)
@@ -9017,7 +9019,7 @@
{
dw2_asm_output_data (l, a->dw_attr_val.v.val_wide->elt (i),
"%s", name);
- name = NULL;
+ name = "";
}
}
break;
@@ -15593,8 +15595,13 @@
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:
Index: rtl.h
===================================================================
--- rtl.h (revision 229720)
+++ rtl.h (working copy)
@@ -2086,6 +2086,7 @@
inline unsigned int
wi::int_traits <rtx_mode_t>::get_precision (const rtx_mode_t &x)
{
+ gcc_checking_assert (x.second != BLKmode && x.second != VOIDmode);
return GET_MODE_PRECISION (x.second);
}