re PR fortran/91564 (ICE in gimplify_expr, at gimplify.c:14147)

2019-08-28  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91564
	* check.c (gfc_check_kill_sub): Additional checks on status dummy
	argument.

2019-08-28  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91564
	* gfortran.dg/pr91564.f90: New test.

From-SVN: r275005
This commit is contained in:
Steven G. Kargl 2019-08-28 19:54:23 +00:00
parent 91eed5f281
commit ab0f6d4c5f
4 changed files with 43 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2019-08-28 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91564
* check.c (gfc_check_kill_sub): Additional checks on status dummy
argument.
2019-08-28 Mark Eggleston <mark.eggleston@codethink.com>
* intrinsics.text: Corrected stated standard for intrinsics

View File

@ -3301,6 +3301,22 @@ gfc_check_kill_sub (gfc_expr *pid, gfc_expr *sig, gfc_expr *status)
if (!scalar_check (status, 2))
return false;
if (status->expr_type != EXPR_VARIABLE)
{
gfc_error ("STATUS at %L shall be an INTENT(OUT) variable",
&status->where);
return false;
}
if (status->expr_type == EXPR_VARIABLE
&& status->symtree && status->symtree->n.sym
&& status->symtree->n.sym->attr.intent == INTENT_IN)
{
gfc_error ("%qs at %L shall be an INTENT(OUT) variable",
status->symtree->name, &status->where);
return false;
}
}
return true;

View File

@ -1,3 +1,8 @@
2019-08-28 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91564
* gfortran.dg/pr91564.f90: New test.
2019-08-28 Martin Sebor <msebor@redhat.com>
PR tree-optimization/91457

View File

@ -0,0 +1,16 @@
! { dg-do compile }
! PR fortran/91564
! Contributed by Gerhard Steinmetz.
program p
integer i, j
call kill (1, 2, 3) ! { dg-error "shall be an INTENT" }
i = 42
call bar(i, j)
end
subroutine bar(n, m)
integer, intent(in) :: n
integer, intent(inout) :: m
call kill (1, 3, n) ! { dg-error "shall be an INTENT" }
call kill (1, 3, m)
end subroutine bar