https://gcc.gnu.org/g:352ef6ba90653652ea2f6fe804e49912493cb816

commit 352ef6ba90653652ea2f6fe804e49912493cb816
Author: Mikael Morin <mik...@gcc.gnu.org>
Date:   Fri Apr 18 18:37:57 2025 +0200

    Correction régression deferred_character_34

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

diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index a92ac70a53c2..bcf027e13615 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -4589,6 +4589,10 @@ done:
          {
            gcc_assert (info->shape != nullptr || ss->dimen == 1);
            tree type = gfc_typenode_for_spec (&ss_info->expr->ts);
+           if (ss_info->expr->ts.type == BT_CHARACTER
+               && ss_info->expr->ts.u.cl->length
+               && ss_info->expr->ts.u.cl->length->expr_type == EXPR_CONSTANT)
+             type = build_pointer_type (type);
            tree spacing = fold_convert_loc (input_location,
                                             gfc_array_index_type,
                                             TYPE_SIZE_UNIT (type));

Reply via email to