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

commit b5c81933b690adf5feafa9c83d854b2cf8766bac
Author: Mikael Morin <mik...@gcc.gnu.org>
Date:   Tue Jun 3 15:51:25 2025 +0200

    Correction régression finalize_15

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

diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index 9ed9f4792cbb..c6d06cee0e17 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -7626,7 +7626,11 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr)
          /* Create a new descriptor if the array doesn't have one.  */
          full = 0;
        }
-      else if (info->ref->u.ar.type == AR_FULL || se->descriptor_only)
+      else if (se->descriptor_only)
+       full = 1;
+      else if (subref_array_target)
+       full = 0;
+      else if (info->ref->u.ar.type == AR_FULL)
        full = 1;
       else if (se->direct_byref)
        full = 0;

Reply via email to