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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2025-05-01
                 CC|                            |anlauf at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW

--- Comment #8 from anlauf at gcc dot gnu.org ---
The following patch fixes the issue:

diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc
index 07e9bac37a1..27497294f8c 100644
--- a/gcc/fortran/expr.cc
+++ b/gcc/fortran/expr.cc
@@ -1194,6 +1195,7 @@ is_subref_array (gfc_expr * e)
         what follows cannot be a subreference array, unless there is a
         substring reference.  */
       if (!seen_array && ref->type == REF_COMPONENT
+         && ref->next == NULL
          && ref->u.c.component->ts.type != BT_CHARACTER
          && ref->u.c.component->ts.type != BT_CLASS
          && !gfc_bt_struct (ref->u.c.component->ts.type))

Reply via email to