re PR fortran/71067 (ICE on data initialization with insufficient value)

2016-07-28  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/71067
	* decl.c (match_data_constant): On error, set 'result' to NULL.

2016-07-28  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/71067
	* gfortran.dg/pr71067_1.f90: New test.
	* gfortran.dg/pr71067_2.f90: Ditto.

From-SVN: r238842
This commit is contained in:
Steven G. Kargl 2016-07-28 23:12:23 +00:00
parent 204ada0caa
commit 89f1f37ea6
5 changed files with 24 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2016-07-28 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/71067
* decl.c (match_data_constant): On error, set 'result' to NULL.
2016-07-28 Steven G. Kargl <kargl@gcc.gnu.org> 2016-07-28 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/71799 PR fortran/71799

View File

@ -395,6 +395,7 @@ match_data_constant (gfc_expr **result)
{ {
gfc_error ("Symbol %qs must be a PARAMETER in DATA statement at %C", gfc_error ("Symbol %qs must be a PARAMETER in DATA statement at %C",
name); name);
*result = NULL;
return MATCH_ERROR; return MATCH_ERROR;
} }
else if (dt_sym && gfc_fl_struct (dt_sym->attr.flavor)) else if (dt_sym && gfc_fl_struct (dt_sym->attr.flavor))

View File

@ -1,3 +1,9 @@
2016-07-28 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/71067
* gfortran.dg/pr71067_1.f90: New test.
* gfortran.dg/pr71067_2.f90: Ditto.
2016-07-28 Michael Meissner <meissner@linux.vnet.ibm.com> 2016-07-28 Michael Meissner <meissner@linux.vnet.ibm.com>
* gcc.target/powerpc/vec-extract-1.c: New test. * gcc.target/powerpc/vec-extract-1.c: New test.

View File

@ -0,0 +1,5 @@
program p
integer :: i = 0
integer :: z(2)
data z /2*i/ ! { dg-error "must be a PARAMETER in DATA" }
end

View File

@ -0,0 +1,7 @@
! { dg-do compile }
program p
integer :: a(2), b(2), c(2)
data a /2*b1'/ ! { dg-error "must be a PARAMETER in DATA" }
data b /2*o1' ! { dg-error "must be a PARAMETER in DATA" }
data c /2*z1 ! { dg-error "must be a PARAMETER in DATA" }
end