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

--- Comment #5 from anlauf at gcc dot gnu.org ---
The ICE is fixed by:

diff --git a/gcc/fortran/trans-stmt.cc b/gcc/fortran/trans-stmt.cc
index 9b497d6bdc6..605107b5168 100644
--- a/gcc/fortran/trans-stmt.cc
+++ b/gcc/fortran/trans-stmt.cc
@@ -6451,6 +6451,7 @@ gfc_trans_allocate (gfc_code * code, gfc_omp_namelist
*omp_allocate)

       /* Special case when string in expr3 is zero.  */
       if (code->expr3->ts.type == BT_CHARACTER
+         && code->expr3->rank == 0
          && integer_zerop (se.string_length))
        {
          gfc_init_se (&se, NULL);

Needs further testing.

Reply via email to