Commit 8b4e5e71 by Steven G. Kargl

re PR fortran/91943 (ICE in gfc_conv_constant_to_tree, at fortran/trans-const.c:370)

2019-10-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91943
	* match.c (gfc_match_call): BOZ cannot be an actual argument in
	a subroutine reference.
	* resolve.c (resolve_function): BOZ cannot be an actual argument in
	a function reference.
 
2019-10-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91943
	gfortran.dg/pr91943.f90

From-SVN: r276471
parent b1fb82e5
2019-10-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91943
* match.c (gfc_match_call): BOZ cannot be an actual argument in
a subroutine reference.
* resolve.c (resolve_function): BOZ cannot be an actual argument in
a function reference.
2019-10-01 Jan Hubicka <jh@suse.cz>
* module.c (load_commons): Initialize flags to 0 to silecne
......
......@@ -4984,6 +4984,16 @@ gfc_match_call (void)
goto syntax;
}
/* Walk the argument list looking for invalid BOZ. */
for (a = arglist; a; a = a->next)
if (a->expr && a->expr->ts.type == BT_BOZ)
{
gfc_error ("A BOZ literal constant at %L cannot appear as an actual "
"argument in a subroutine reference", &a->expr->where);
goto cleanup;
}
/* If any alternate return labels were found, construct a SELECT
statement that will jump to the right place. */
......
......@@ -3242,6 +3242,21 @@ resolve_function (gfc_expr *expr)
if (expr->expr_type != EXPR_FUNCTION)
return t;
/* Walk the argument list looking for invalid BOZ. */
if (expr->value.function.esym)
{
gfc_actual_arglist *a;
for (a = expr->value.function.actual; a; a = a->next)
if (a->expr && a->expr->ts.type == BT_BOZ)
{
gfc_error ("A BOZ literal constant at %L cannot appear as an "
"actual argument in a function reference",
&a->expr->where);
return false;
}
}
temp = need_full_assumed_size;
need_full_assumed_size = 0;
......
2019-10-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91943
gfortran.dg/pr91943.f90
2019-10-02 Jan Hubicka <hubicka@ucw.cz>
* g++.dg/tree-ssa/pr53844.C: Add -fno-inline-functions --param
......
! { dg-do compile }
! PR fortran/91943
! Code contributed by Gerhard Steinmetz
program p
print *, f(b'1001') ! { dg-error "cannot appear as an actual argument" }
call sub(b'1001') ! { dg-error "cannot appear as an actual argument" }
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