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: Thu, 05 Nov 2015 12:32:00 -0000	[thread overview]
Message-ID: <CAFiYyc1Cx4oV217zo3Z-+Hb779mqPA7mPecWJ1mLy4ziMrW9SQ@mail.gmail.com> (raw)
In-Reply-To: <721A5B44-82AC-4D72-9E50-500D5E5A7EC5@comcast.net>

On Thu, Nov 5, 2015 at 12:45 AM, Mike Stump <mikestump@comcast.net> wrote:
>
> On Nov 4, 2015, at 12:50 PM, Richard Sandiford <richard.sandiford@arm.com> wrote:
>
>> 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;
>
> Yeah, seems like we should have a v1.prec == v2.prec && on that.  The bad news, there are four of them that are like this.  The good news, 3 of them are location operands, and I don’t think they can hit for a very long time.  I think this is an oversight from the double_int version of the code where we just check the 128 bits for equality.  We can see if Richard wants to weigh in.  I think I’d just pre-approve the change, though, I think a helper to perform mixed equality testing would be the way to go as there are 4 of them, and I pretty sure they should all use the mixed version.  Though, maybe the location list versions are never mixed.  If they aren’t, then there is only 1 client, so, I’d just do the precision test inline.  Anyone able to comment on the location list aspect of this?

No idea on location lists but maybe this means we should just use the
maximum supported integer mode for CONST_WIDE_INTs?

  reply	other threads:[~2015-11-05 12:32 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 [this message]
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=CAFiYyc1Cx4oV217zo3Z-+Hb779mqPA7mPecWJ1mLy4ziMrW9SQ@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).