Commit ce7fb711 by Steven G. Kargl

re PR fortran/66043 (ICE on storage_size of null or output of null array)

2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/66043
	* check.c (gfc_check_storage_size): Prevent the direct use of NULL()
	in STORAGE_SIZE() reference.

2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/66043
	* gfortran.dg/storage_size_6.f90: New tests.

From-SVN: r223320
parent 46b6b354
2015-05-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66043
* gfortran.dg/storage_size_6.f90: New tests.
2015-05-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66040
* parse.c(verify_st_order): Replace a gfc_internal_error with your
generic gfc_error.
......
......@@ -6243,6 +6243,15 @@ gfc_check_and (gfc_expr *i, gfc_expr *j)
bool
gfc_check_storage_size (gfc_expr *a, gfc_expr *kind)
{
if (a->expr_type == EXPR_NULL)
{
gfc_error ("Intrinsic function NULL at %L cannot be an actual "
"argument to STORAGE_SIZE, because it returns a "
"disassociated pointer", &a->where);
return false;
}
if (a->ts.type == BT_ASSUMED)
{
gfc_error ("%qs argument of %qs intrinsic at %L shall not be TYPE(*)",
......
2015-05-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66043
* gfortran.dg/storage_size_6.f90: New tests.
2015-05-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66040
* gfortran.dg/misplaced_statement.f90: New test.
......
! { dg-do compile }
! PR fortran/66043
!
! Original code from Gerhard Steinmetz
! <gerhard dot steinmetz dot fortran at t-online dot de>
program p
print *, storage_size(null()) ! { dg-error "cannot be an actual" }
end
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