gcc/fortran/ChangeLog:
PR fortran/69419
* match.c (gfc_match_common): Check array spec of a symbol in a
COMMON object list and reject it if it is a coarray.
gcc/testsuite/ChangeLog:
PR fortran/69419
* gfortran.dg/pr69419.f90: New test.
goto cleanup;
}
+ if (as->corank)
+ {
+ gfc_error ("Symbol %qs in COMMON at %C cannot be a "
+ "coarray", sym->name);
+ goto cleanup;
+ }
+
if (!gfc_add_dimension (&sym->attr, sym->name, NULL))
goto cleanup;
--- /dev/null
+! { dg-do compile }
+! { dg-options "-fcoarray=lib" }
+! PR fortran/69419 - ICE on invalid coarray in common
+
+blockdata b
+ real x ! { dg-error "must be in COMMON" }
+ common /c/ x[*] ! { dg-error "cannot be a coarray" }
+ data x /1.0/
+end