From patchwork Fri Aug 26 07:17:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 14943 Received: (qmail 62042 invoked by alias); 26 Aug 2016 07:17:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 62022 invoked by uid 89); 26 Aug 2016 07:17:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 26 Aug 2016 07:17:46 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5973385A06; Fri, 26 Aug 2016 07:17:45 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-34.ams2.redhat.com [10.36.116.34]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7Q7HfFe016128 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 26 Aug 2016 03:17:44 -0400 Date: Fri, 26 Aug 2016 09:17:41 +0200 From: Jan Kratochvil To: Bernhard Heckel Cc: "Weinmann, Christoph T" , gdb-patches@sourceware.org Subject: Re: [V4 00/21] Fortran dynamic array support Message-ID: <20160826071741.GA20908@host1.jankratochvil.net> References: <88072818E0A3D742B2B1AF16BBEC65A7263E8FD9@IRSMSX107.ger.corp.intel.com> <20160716151310.GA14331@host1.jankratochvil.net> <20160716151837.GA797@host1.jankratochvil.net> <88072818E0A3D742B2B1AF16BBEC65A7263F0988@IRSMSX107.ger.corp.intel.com> <20160816135920.GA26624@host1.jankratochvil.net> <57B6D831.4080605@intel.com> <20160821170346.GA21909@host1.jankratochvil.net> <57BC50D1.4020102@intel.com> <20160825170626.GA29717@host1.jankratochvil.net> <20160825172217.GA17432@host1.jankratochvil.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160825172217.GA17432@host1.jankratochvil.net> User-Agent: Mutt/1.6.2 (2016-07-01) X-IsSubscribed: yes On Thu, 25 Aug 2016 19:22:17 +0200, Jan Kratochvil wrote: > I see the source handles negative stide specially. Particularly the comment > here does not explain the code it comments: With the attached patch disabling these cases still the supplied gdb.fortran/static-arrays.exp and gdb.fortran/vla-stride.exp PASS (on Fedora 24 x86_64). Jan diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 88801ac..695825a 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -2197,12 +2197,14 @@ resolve_dynamic_type_internal (struct type *type, { struct type *range_type = TYPE_INDEX_TYPE (resolved_type); +#if 0 /* Adjust the data location with the value of byte stride if set, which can describe the separation between successive elements along the dimension. */ if (TYPE_BYTE_STRIDE (range_type) < 0) value += (TYPE_HIGH_BOUND (range_type) - TYPE_LOW_BOUND (range_type)) * TYPE_BYTE_STRIDE (range_type); +#endif TYPE_DATA_LOCATION_ADDR (resolved_type) = value; TYPE_DATA_LOCATION_KIND (resolved_type) = PROP_CONST; diff --git a/gdb/valarith.c b/gdb/valarith.c index 9093969..eca7992 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -199,12 +199,14 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) if (elt_stride > 0) elt_offs *= elt_stride; +#if 0 else if (elt_stride < 0) { int offs = (elt_offs + 1) * elt_stride; elt_offs = TYPE_LENGTH (array_type) + offs; } +#endif else elt_offs *= elt_size;