+2020-04-20 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/93364
+ * array.c (gfc_set_array_spec): Check for sum of rank and corank
+ not exceeding GFC_MAX_DIMENSIONS.
+
2020-04-20 Steve Kargl <kargl@gcc.gnu.org>
Thomas Koenig <tkoenig@gcc.gnu.org>
return false;
}
+ /* Check F2018:C822. */
+ if (sym->as->rank + sym->as->corank > GFC_MAX_DIMENSIONS)
+ goto too_many;
+
if (as->corank)
{
sym->as->cotype = as->cotype;
+2020-04-20 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/93364
+ * gfortran.dg/pr93364.f90: New test.
+
2020-04-20 Steve Kargl <kargl@gcc.gnu.org>
Thomas Koenig <tkoenig@gcc.gnu.org>
--- /dev/null
+! { dg-do compile }
+! { dg-options "-fcoarray=single" }
+!
+! PR fortran/93364 - check fix for ICE in gfc_set_array_spec
+
+type(t) function f()
+ codimension :: t[1,2,1,2,1,2,1,*]
+ dimension :: t(1,2,1,2,1,2,1,2)
+end
+
+! { dg-error "has not been declared" " " { target *-*-* } 6 }
+! { dg-error "is of type 't'" " " { target *-*-* } 6 }
+! { dg-error "rank \\+ corank of" " " { target *-*-* } 8 }