re PR fortran/88206 (ICE in gfc_match_type_spec, at fortran/match.c:2229)

2018-12-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88206
	* match.c (gfc_match_type_spec): REAL can be an intrinsic function.

2018-12-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88206
	* gfortran.dg/pr88206.f90: New test.

From-SVN: r266930
This commit is contained in:
Steven G. Kargl 2018-12-09 19:10:57 +00:00
parent d0cbb206e2
commit 6dc5aacf97
4 changed files with 23 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2018-12-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88206
* match.c (gfc_match_type_spec): REAL can be an intrinsic function.
2018-12-09 Fritz Reese <fritzoreese@gmail.com>
PR fortran/88228

View File

@ -2225,6 +2225,9 @@ found:
return MATCH_NO;
}
if (e->expr_type != EXPR_CONSTANT)
goto ohno;
gfc_next_char (); /* Burn the ')'. */
ts->kind = (int) mpz_get_si (e->value.integer);
if (gfc_validate_kind (ts->type, ts->kind , true) == -1)
@ -2239,6 +2242,8 @@ found:
}
}
ohno:
/* If a type is not matched, simply return MATCH_NO. */
gfc_current_locus = old_locus;
return MATCH_NO;

View File

@ -1,3 +1,8 @@
2018-12-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88206
* gfortran.dg/pr88206.f90: New test.
2018-12-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88228

View File

@ -0,0 +1,8 @@
! { dg-do compile }
! PR fortran/88206
program p
integer, parameter :: z(4) = [1,2,3,4]
integer :: k = 2
print *, [real(z(k))]
end