https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88205
--- Comment #2 from kargl at gcc dot gnu.org --- Index: gcc/fortran/io.c =================================================================== --- gcc/fortran/io.c (revision 266386) +++ gcc/fortran/io.c (working copy) @@ -2161,6 +2161,12 @@ gfc_match_open (void) if (!open->file && open->status) { + if (open->status->ts.type != BT_CHARACTER) + { + gfc_error ("STATUS must be a default character type at %C"); + goto cleanup; + } + if (open->status->expr_type == EXPR_CONSTANT && gfc_wide_strncasecmp (open->status->value.character.string, "scratch", 7) != 0)