Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [rfc] Fix bitfield regressions on 64-bit big-endian targets
Date: Sun, 27 Sep 2009 22:28:00 -0000	[thread overview]
Message-ID: <20090927222844.GA32132@caradoc.them.org> (raw)
In-Reply-To: <200909272148.n8RLmY2f032091@d12av02.megacenter.de.ibm.com>

On Sun, Sep 27, 2009 at 11:48:34PM +0200, Ulrich Weigand wrote:
> Daniel Jacobowitz wrote:
> 
> > value_offset for a bitfield is an offset to be added into the parent's
> > contents.  So including the parent's offset is incorrect; the attached
> > test shows that we were reading the wrong location.  With large enough
> > offsets, we could wander off to another page of memory and fault.
> 
> This changes the value_offset for a bitfield, but does not adapt all
> places where the offset is used; in particular value_assign still does
> not take the parent's offset into account.
> 
> This causes a significant number of store.exp testsuite failures on
> s390x-linux and ppc64-linux (and presumably other 64-bit big-endian
> platforms).
> 
> The following patch updates value_assign to respect the parent offset,
> which fixes all those failures.
> 
> Tested on s390(x)-linux and ppc(64)-linux with no regressions.
> 
> Does this look OK to you?

It looks like the code you're fixing was completely bogus.

> !             && ((LONGEST) value_address (toval) % TYPE_LENGTH (type)) == 0)

What does that even mean?  We set v->offset, both before and after the
patch you're replying to, but we never set value->location.address.
Are we only testing this in registers somehow where no address was
required?  Or am I missing where the location was set?

Your patch looks fine to me.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2009-09-27 22:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-28 19:55 [commit] Fix bitfield errors - PR 10565 Daniel Jacobowitz
2009-09-27 21:48 ` [rfc] Fix bitfield regressions on 64-bit big-endian targets Ulrich Weigand
2009-09-27 22:28   ` Daniel Jacobowitz [this message]
2009-09-28  9:20     ` Ulrich Weigand
2009-09-28 16:33       ` Daniel Jacobowitz
2009-09-28 18:07       ` Joel Brobecker
2009-09-28 18:32         ` Daniel Jacobowitz
2009-09-29  0:44           ` Ulrich Weigand

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=20090927222844.GA32132@caradoc.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --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