]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix Fortran array-access regressions
authorKwok Cheung Yeung <kcy@codesourcery.com>
Wed, 25 May 2022 11:10:03 +0000 (12:10 +0100)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 28 Jun 2022 20:55:30 +0000 (13:55 -0700)
The arguments to gfc_build_array_ref were recently updated in the commit
'fortran: Use pointer arithmetic to index arrays [PR102043]', but a call
from gfc_conv_array_ref used the old function signature.  This went
unnoticed due to the use of default arguments.

This patch should be merged into 'Fortran: delinearize multi-dimensional
array accesses'.

2022-05-22  Kwok Cheung Yeung  <kcy@codesourcery.com>

gcc/fortran/
* trans-array.cc (gfc_conv_array_ref): Update arguments to
gfc_build_array_ref.

gcc/fortran/ChangeLog.omp
gcc/fortran/trans-array.cc

index ec748026a73e8db75772518caa6dd7e46d87210c..59f47d73b735f127c151eb603eba5db2e561ce63 100644 (file)
@@ -1,3 +1,8 @@
+2022-05-22  Kwok Cheung Yeung  <kcy@codesourcery.com>
+
+       * trans-array.cc (gfc_conv_array_ref): Update arguments to
+       gfc_build_array_ref.
+
 2022-05-05  Sandra Loosemore  <sandra@codesourcery.com>
 
        Backport from mainline:
index ac2bac707c16ca322d82d7b3f2d778c890119246..9c4931db9162f4e41b77838702f136df6479cba0 100644 (file)
@@ -4205,11 +4205,11 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar, gfc_expr *expr,
                                  gfc_array_index_type, offset, cst_offset);
       se->class_vptr = vptr;
       vptr = get_class_array_vptr (se->expr, vptr);
-      se->expr = gfc_build_array_ref (base, offset, cooked_decl, vptr);
+      se->expr = gfc_build_array_ref (base, offset, cooked_decl, false, vptr);
     }
- else
-   /* Return the outermost ARRAY_REF we already built.  */
-   se->expr = aref;
 else
+    /* Return the outermost ARRAY_REF we already built.  */
+    se->expr = aref;
 }