public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Mike Stump <mikestump@comcast.net>
Cc: Richard Sandiford <richard.sandiford@arm.com>,
	Bernd Schmidt <bschmidt@redhat.com>,
		Ulrich Weigand <uweigand@de.ibm.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [ping] Fix PR debug/66728
Date: Fri, 06 Nov 2015 13:06:00 -0000	[thread overview]
Message-ID: <CAFiYyc2KvBw_fhhC+MXSzzbg445tPwwSXHKiO3TLAqfqQow7NA@mail.gmail.com> (raw)
In-Reply-To: <8D9ED969-8205-45E2-A6FD-3040ECF97E81@comcast.net>

On Fri, Nov 6, 2015 at 2:34 AM, Mike Stump <mikestump@comcast.net> wrote:
> 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?

Ok with a changelog entry and bootstrap/regtest.

Thanks,
Richard.

>
> 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);
>  }
>

  reply	other threads:[~2015-11-06 13:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-21 14:24 Richard Sandiford
2015-08-21 16:20 ` Jeff Law
2015-10-28 12:04 ` [ping] " Ulrich Weigand
2015-10-28 13:14   ` Richard Sandiford
2015-10-28 14:25     ` Bernd Schmidt
2015-10-28 14:58       ` Ulrich Weigand
2015-11-02 15:30       ` Richard Sandiford
2015-11-02 16:29         ` Richard Sandiford
2015-11-02 20:34           ` [ping] " Mike Stump
2015-11-02 20:55             ` Richard Sandiford
2015-11-02 23:29               ` Mike Stump
2015-11-03  8:46                 ` Richard Sandiford
2015-11-03 21:59                   ` Mike Stump
2015-11-04  9:43                     ` Richard Biener
2015-11-04 11:58                       ` Mike Stump
2015-11-04 12:15                         ` Richard Biener
2015-11-04 19:36                           ` Mike Stump
2015-11-04 20:51                             ` Richard Sandiford
2015-11-04 23:45                               ` Mike Stump
2015-11-05 12:32                                 ` Richard Biener
2015-11-06  1:35                                   ` Mike Stump
2015-11-06 13:06                                     ` Richard Biener [this message]
2015-11-09 18:47                                       ` Mike Stump

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFiYyc2KvBw_fhhC+MXSzzbg445tPwwSXHKiO3TLAqfqQow7NA@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=bschmidt@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mikestump@comcast.net \
    --cc=richard.sandiford@arm.com \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).