re PR fortran/87994 (ICE in match_data_constant, at fortran/decl.c:399)

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

	PR fortran/87944
	* decl.c (match_data_constant): Allow inquiry parameter as data
	constant in data statement.

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

	PR fortran/87944
	* gfortran.dg/pr87994_1.f90: New test.
	* gfortran.dg/pr87994_2.f90: Ditto.
	* gfortran.dg/pr87994_3.f90: Ditto.

From-SVN: r267184
This commit is contained in:
Steven G. Kargl 2018-12-16 03:33:05 +00:00
parent 3dd6f57375
commit 19adb97a31
6 changed files with 45 additions and 2 deletions

View File

@ -1,4 +1,10 @@
2019-12-15 Steven G. Kargl <kargl@gcc.gnu.org>
2018-12-15 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/87944
* decl.c (match_data_constant): Allow inquiry parameter as data
constant in data statement.
2018-12-15 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88138
* decl.c (variable_decl): Check that a derived isn't being assigned

View File

@ -399,6 +399,14 @@ match_data_constant (gfc_expr **result)
}
else if (m == MATCH_YES)
{
/* If a parameter inquiry ends up here, symtree is NULL but **result
contains the right constant expression. Check here. */
if ((*result)->symtree == NULL
&& (*result)->expr_type == EXPR_CONSTANT
&& ((*result)->ts.type == BT_INTEGER
|| (*result)->ts.type == BT_REAL))
return m;
/* F2018:R845 data-stmt-constant is initial-data-target.
A data-stmt-constant shall be ... initial-data-target if and
only if the corresponding data-stmt-object has the POINTER

View File

@ -1,3 +1,10 @@
2018-12-15 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/87944
* gfortran.dg/pr87994_1.f90: New test.
* gfortran.dg/pr87994_2.f90: Ditto.
* gfortran.dg/pr87994_3.f90: Ditto.
2018-12-16 Jakub Jelinek <jakub@redhat.com>
PR c++/88482
@ -10,7 +17,7 @@
* g++.dg/eh/builtin11.C: New test.
* g++.dg/parse/crash55.C: Adjust expected diagnostics.
2019-12-15 Steven G. Kargl <kargl@gcc.gnu.org>
2018-12-15 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88138
* gfortran.dg/pr88138.f90: new test.

View File

@ -0,0 +1,7 @@
! { dg-do run }
! PR fortran/87994
program p
real :: a, b
data b /a%kind/
if (b /= kind(a)) stop 1
end

View File

@ -0,0 +1,7 @@
! { dg-do run }
! PR fortran/87994
program p
real, parameter :: a = 1.0
data b /a%kind/
if (b /= kind(a)) stop 1
end

View File

@ -0,0 +1,8 @@
! { dg-do run }
! PR fortran/87994
program p
integer, parameter :: a = 1
integer :: b
data b /a%kind/
if (b /= kind(a)) stop = 1
end