https://gcc.gnu.org/g:17be08fca6fbfe608621927e398f45bd203d83e1

commit 17be08fca6fbfe608621927e398f45bd203d83e1
Author: Mikael Morin <mik...@gcc.gnu.org>
Date:   Mon May 5 20:22:15 2025 +0200

    Correction régression oldstyle_1

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

diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index e1c21fb6308f..cb95aa50cf80 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -6058,6 +6058,14 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr)
              else
                tmp1 = gfc_conv_mpz_to_tree (c->offset, gfc_index_integer_kind);
 
+             if (min_index)
+               {
+                 tmp1 = fold_build2_loc (input_location, PLUS_EXPR,
+                                         TREE_TYPE (tmp1), tmp1, min_index);
+                 tmp2 = fold_build2_loc (input_location, PLUS_EXPR,
+                                         TREE_TYPE (tmp2), tmp2, min_index);
+               }
+
              range = fold_build2 (RANGE_EXPR, gfc_array_index_type, tmp1, 
tmp2);
              mpz_clear (maxval);
            }

Reply via email to