https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66578

--- Comment #8 from Mikael Morin <mikael at gcc dot gnu.org> ---
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index fece3ab..0b96de1 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -7079,7 +7077,7 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr)
            {
              tmp = gfc_conv_array_lbound (desc, n);
              tmp = fold_build2_loc (input_location, MINUS_EXPR,
-                                    TREE_TYPE (base), tmp, loop.from[dim]);
+                                    TREE_TYPE (base), tmp, from);
              tmp = fold_build2_loc (input_location, MULT_EXPR,
                                     TREE_TYPE (base), tmp,
                                     gfc_conv_array_stride (desc, n));

Reply via email to