diff mbox

[V4,00/21] Fortran dynamic array support

Message ID 20160826071741.GA20908@host1.jankratochvil.net
State New
Headers show

Commit Message

Jan Kratochvil Aug. 26, 2016, 7:17 a.m. UTC
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

Comments

Heckel, Bernhard Sept. 1, 2016, 10:11 a.m. UTC | #1
On 26/08/2016 09:17, Jan Kratochvil wrote:
> 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
Hi Jan,

I am just setting up a Fedora24 environment. I will look into this 
stride issue and update the branch
with your current findings.


Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
diff mbox

Patch

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;