aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r--gcc/fortran/io.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index fddd36b..da0e1c5 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -1890,13 +1890,16 @@ gfc_match_open (void)
goto cleanup;
}
- if (!(open->file || (open->status
- && gfc_wide_strncasecmp (open->status->value.character.string,
- "scratch", 7) == 0)))
- {
- gfc_error ("NEWUNIT specifier must have FILE= "
- "or STATUS='scratch' at %C");
- goto cleanup;
+ if (!open->file && open->status)
+ {
+ if (open->status->expr_type == EXPR_CONSTANT
+ && gfc_wide_strncasecmp (open->status->value.character.string,
+ "scratch", 7) != 0)
+ {
+ gfc_error ("NEWUNIT specifier must have FILE= "
+ "or STATUS='scratch' at %C");
+ goto cleanup;
+ }
}
}
else if (!open->unit)