https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92990
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P5
Status|UNCONFIRMED |NEW
Last reconfirmed| |2019-12-19
Ever confirmed|0 |1
--- Comment #1 from anlauf at gcc dot gnu.org ---
How about a simple approach to catch this early?
Beware: this is untested.
Index: gcc/fortran/match.c
===================================================================
--- gcc/fortran/match.c (Revision 279592)
+++ gcc/fortran/match.c (Arbeitskopie)
@@ -4589,6 +4589,19 @@ gfc_match_nullify (void)
goto cleanup;
}
+ /* Check for valid array pointer object. Bounds remapping is not
+ allowed with NULLIFY. */
+ if (p->ref)
+ {
+ gfc_ref* remap;
+ for (remap = p->ref; remap; remap = remap->next)
+ if (!remap->next && remap->type == REF_ARRAY
+ && remap->u.ar.type != AR_FULL)
+ break;
+ if (remap)
+ goto syntax;
+ }
+
/* build ' => NULL() '. */
e = gfc_get_null_expr (&gfc_current_locus);