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

commit c0da2c45ed1f462f924810bc1959b9001cb50b76
Author: Mikael Morin <[email protected]>
Date:   Wed Oct 1 13:21:17 2025 +0200

    Correction régression alloc_comp_constructor_2.f90

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

diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index 0a3e8c5bcfc8..4768c5fede31 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -7723,6 +7723,7 @@ is_explicit_coarray (gfc_expr *expr)
   return cas && cas->cotype == AS_EXPLICIT;
 }
 
+
 /* Convert an array for passing as an actual argument.  Expressions and
    vector subscripts are evaluated and stored in a temporary, which is then
    passed.  For whole arrays the descriptor is passed.  For array sections
@@ -8161,8 +8162,12 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr)
          else
            parmtype = gfc_get_element_type (TREE_TYPE (desc));
 
+         bool contiguous = !GFC_BYTES_STRIDES_ARRAY_TYPE_P (TREE_TYPE (desc))
+                           && info->ref
+                           && info->ref->u.ar.type == AR_FULL
+                           && !info->ref->next;
          parmtype = gfc_get_array_type_bounds (parmtype, loop.dimen, codim,
-                                               loop.from, loop.to, 0,
+                                               loop.from, loop.to, contiguous,
                                                GFC_ARRAY_UNKNOWN, false);
          parm = gfc_create_var (parmtype, "parm");

Reply via email to