https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88299
--- Comment #4 from Harald Anlauf <anlauf at gmx dot de> ---
I'm currently regtesting the following patch:
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 268778)
+++ gcc/fortran/resolve.c (working copy)
@@ -940,7 +940,11 @@
have been ignored to continue parsing.
We do the checks again here. */
if (!csym->attr.use_assoc)
- gfc_add_in_common (&csym->attr, csym->name, &common_block->where);
+ {
+ gfc_add_in_common (&csym->attr, csym->name, &common_block->where);
+ gfc_notify_std (GFC_STD_F2018_OBS, "COMMON block at %L",
+ &common_block->where);
+ }
if (csym->value || csym->attr.data)
{
@@ -998,10 +1002,6 @@
resolve_common_vars (common_root->n.common, true);
- if (!gfc_notify_std (GFC_STD_F2018_OBS, "COMMON block at %L",
- &common_root->n.common->where))
- return;
-
/* The common name is a global name - in Fortran 2003 also if it has a
C binding name, since Fortran 2008 only the C binding name is a global
identifier. */