From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22959 invoked by alias); 27 Sep 2009 22:28:53 -0000 Received: (qmail 22951 invoked by uid 22791); 27 Sep 2009 22:28:52 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 27 Sep 2009 22:28:47 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 3B6201088A; Sun, 27 Sep 2009 22:29:09 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 18B7610666; Sun, 27 Sep 2009 22:29:09 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1Ms2EW-0000Ad-He; Sun, 27 Sep 2009 18:28:44 -0400 Date: Sun, 27 Sep 2009 22:28:00 -0000 From: Daniel Jacobowitz To: Ulrich Weigand Cc: gdb-patches@sourceware.org Subject: Re: [rfc] Fix bitfield regressions on 64-bit big-endian targets Message-ID: <20090927222844.GA32132@caradoc.them.org> Mail-Followup-To: Ulrich Weigand , gdb-patches@sourceware.org References: <20090828184942.GA5711@caradoc.them.org> <200909272148.n8RLmY2f032091@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200909272148.n8RLmY2f032091@d12av02.megacenter.de.ibm.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00858.txt.bz2 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