Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: gdb-patches@sourceware.org, Tom Tromey <tromey@adacore.com>
Subject: Re: [PATCH] Fix bit offset regression
Date: Fri, 09 Oct 2020 11:18:36 -0600	[thread overview]
Message-ID: <87v9fjb9n7.fsf@tromey.com> (raw)
In-Reply-To: <20201009142707.GR605036@embecosm.com> (Andrew Burgess's message of "Fri, 9 Oct 2020 15:27:07 +0100")

>> SET_FIELD_BITPOS (*fp, (FIELD_BITPOS (*fp)
>> -				      + attr->as_unsigned ()));
>> +				      + attr->constant_value (0)));

Andrew> I wondered what the `0` was all about here, so I took a look...

[...]

Andrew> I'm not sure I'm any more enlightened about the default value...

It's a bit of an API error, IMO.

Basically, constant_value lets you specify a default, so that if the
attribute does not have constant form, then the default is returned.
However, in this patch (and perhaps in other cases, I didn't look), the
attribute is already known to have constant form, so there's no need for
a default.

Perhaps I should add a default-less overload that asserts.
What do you think?

Andrew> None of which has anything to do with your patch, which looks
Andrew> fine.

I'm going to check it in.

Tom

      reply	other threads:[~2020-10-09 17:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 13:41 Tom Tromey
2020-10-09 14:27 ` Andrew Burgess
2020-10-09 17:18   ` Tom Tromey [this message]

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=87v9fjb9n7.fsf@tromey.com \
    --to=tromey@adacore.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    /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