https://gcc.gnu.org/g:c5c978ca01f4fa09adb56f5a10f6a32d2c89c7ca

commit c5c978ca01f4fa09adb56f5a10f6a32d2c89c7ca
Author: Mikael Morin <[email protected]>
Date:   Mon Oct 13 22:07:28 2025 +0200

    Correction partielle class_elemental_1.f90

Diff:
---
 gcc/fortran/trans-array.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index b2d1fda2f3f3..4fc633c2cf86 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -5951,7 +5951,8 @@ gfc_set_delta (gfc_loopinfo *loop)
              /* Calculate the offset relative to the loop variable.
                 First multiply by the stride.  */
              tmp = loop->from[n];
-             if (!integer_onep (info->stride[dim]))
+             if (ss_type == GFC_SS_SECTION
+                 && !integer_onep (info->stride[dim]))
                tmp = fold_build2_loc (input_location, MULT_EXPR,
                                       gfc_array_index_type,
                                       tmp, info->stride[dim]);

Reply via email to