public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: Mike Stump <mikestump@comcast.net>
Cc: Richard Biener <richard.guenther@gmail.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: Wed, 04 Nov 2015 20:51:00 -0000	[thread overview]
Message-ID: <87mvuttrnz.fsf@e105548-lin.cambridge.arm.com> (raw)
In-Reply-To: <8AEB7496-7440-4239-95E9-272C6EF2AB70@comcast.net> (Mike Stump's	message of "Wed, 4 Nov 2015 11:35:15 -0800")

Mike Stump <mikestump@comcast.net> writes:
> Index: dwarf2out.c
> ===================================================================
> --- dwarf2out.c	(revision 229720)
> +++ dwarf2out.c	(working copy)
> @@ -15593,8 +15593,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);
> +	int prec = MIN (wi::min_precision (w1, UNSIGNED),
> +			(unsigned int)CONST_WIDE_INT_NUNITS (rtl) * HOST_BITS_PER_WIDE_INT);
> +	wide_int w = wide_int::from (w1, prec, UNSIGNED);
> +	add_AT_wide (die, DW_AT_const_value, w);
> +      }
>        return true;
>  
>      case CONST_DOUBLE:

Setting the precision based on CONST_WIDE_INT_NUNITS means that
we might end up with two different precisions for two values of
the same variable.  E.g. for a 192-bit type, 1<<64 would be given
a precision of 128 (because it needs two HWIs to store) but 1<<128
would be given a precision of 192 (because it needs three HWIs to store).
We could then abort when comparing them for equality, since equality
needs both integers to have the same precision.  E.g. from same_dw_val_p:

    case dw_val_class_wide_int:
      return *v1->v.val_wide == *v2->v.val_wide;

Thanks,
Richard

  reply	other threads:[~2015-11-04 20:51 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 [this message]
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
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=87mvuttrnz.fsf@e105548-lin.cambridge.arm.com \
    --to=richard.sandiford@arm.com \
    --cc=bschmidt@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mikestump@comcast.net \
    --cc=richard.guenther@gmail.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).