Commit 1a6872a2 by Steven G. Kargl

re PR fortran/66724 (ICE on input/output statements with wrong specifier data)

2015-07-16  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/66724
	PR fortran/66724
	* io.c (is_char_type): Call gfc_resolve_expr ().
	(match_open_element, match_dt_element, match_inquire_element): Fix
	ASYNCHRONOUS case.

From-SVN: r225913
parent 1470e75f
2015-07-16 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66724
PR fortran/66724
* io.c (is_char_type): Call gfc_resolve_expr ().
(match_open_element, match_dt_element, match_inquire_element): Fix
ASYNCHRONOUS case.
2015-07-15 Andrew MacLeod <amacleod@redhat.com> 2015-07-15 Andrew MacLeod <amacleod@redhat.com>
* trans-types.c: Remove multiline #include comment. * trans-types.c: Remove multiline #include comment.
......
...@@ -1260,6 +1260,8 @@ check_char_variable (gfc_expr *e) ...@@ -1260,6 +1260,8 @@ check_char_variable (gfc_expr *e)
static bool static bool
is_char_type (const char *name, gfc_expr *e) is_char_type (const char *name, gfc_expr *e)
{ {
gfc_resolve_expr (e);
if (e->ts.type != BT_CHARACTER) if (e->ts.type != BT_CHARACTER)
{ {
gfc_error ("%s requires a scalar-default-char-expr at %L", gfc_error ("%s requires a scalar-default-char-expr at %L",
...@@ -1580,6 +1582,8 @@ match_open_element (gfc_open *open) ...@@ -1580,6 +1582,8 @@ match_open_element (gfc_open *open)
match m; match m;
m = match_etag (&tag_e_async, &open->asynchronous); m = match_etag (&tag_e_async, &open->asynchronous);
if (m == MATCH_YES && !is_char_type ("ASYNCHRONOUS", open->asynchronous))
return MATCH_ERROR;
if (m != MATCH_NO) if (m != MATCH_NO)
return m; return m;
m = match_etag (&tag_unit, &open->unit); m = match_etag (&tag_unit, &open->unit);
...@@ -2752,6 +2756,8 @@ match_dt_element (io_kind k, gfc_dt *dt) ...@@ -2752,6 +2756,8 @@ match_dt_element (io_kind k, gfc_dt *dt)
} }
m = match_etag (&tag_e_async, &dt->asynchronous); m = match_etag (&tag_e_async, &dt->asynchronous);
if (m == MATCH_YES && !is_char_type ("ASYNCHRONOUS", dt->asynchronous))
return MATCH_ERROR;
if (m != MATCH_NO) if (m != MATCH_NO)
return m; return m;
m = match_etag (&tag_e_blank, &dt->blank); m = match_etag (&tag_e_blank, &dt->blank);
...@@ -3986,6 +3992,8 @@ match_inquire_element (gfc_inquire *inquire) ...@@ -3986,6 +3992,8 @@ match_inquire_element (gfc_inquire *inquire)
RETM m = match_vtag (&tag_write, &inquire->write); RETM m = match_vtag (&tag_write, &inquire->write);
RETM m = match_vtag (&tag_readwrite, &inquire->readwrite); RETM m = match_vtag (&tag_readwrite, &inquire->readwrite);
RETM m = match_vtag (&tag_s_async, &inquire->asynchronous); RETM m = match_vtag (&tag_s_async, &inquire->asynchronous);
if (m == MATCH_YES && !is_char_type ("ASYNCHRONOUS", inquire->asynchronous))
return MATCH_ERROR;
RETM m = match_vtag (&tag_s_delim, &inquire->delim); RETM m = match_vtag (&tag_s_delim, &inquire->delim);
RETM m = match_vtag (&tag_s_decimal, &inquire->decimal); RETM m = match_vtag (&tag_s_decimal, &inquire->decimal);
RETM m = match_out_tag (&tag_size, &inquire->size); RETM m = match_out_tag (&tag_size, &inquire->size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment