From 405e87e8259b6e70bdf31544bb0e5d147e6f301a Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Fri, 11 Oct 2019 17:52:27 +0000 Subject: re PR fortran/92018 (ICE in gfc_conv_constant_to_tree, at fortran/trans-const.c:370) 2019-10-11 Steven G. Kargl PR fortran/92018 * check.c (reset_boz): New function. (illegal_boz_arg, boz_args_check, gfc_check_complex, gfc_check_float, gfc_check_transfer): Use it. (gfc_check_dshift): Use reset_boz, and re-arrange the checking to help suppress possible run-on errors. (gfc_check_and): Restore checks for valid argument types. Use reset_boz, and re-arrange the checking to help suppress possible un-on errors. * resolve.c (resolve_function): Actual arguments cannot be BOZ in a function reference. 2019-10-11 Steven G. Kargl PR fortran/92018 * gfortran.dg/gnu_logical_2.f90: Update dg-error regex. * gfortran.dg/pr81509_2.f90: Ditto. * gfortran.dg/pr92018.f90: New test. From-SVN: r276898 --- gcc/fortran/resolve.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'gcc/fortran/resolve.c') diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 20ecafd..71539fe 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -3243,19 +3243,14 @@ resolve_function (gfc_expr *expr) 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; - } - } + for (arg = expr->value.function.actual; arg; arg = arg->next) + if (arg->expr && arg->expr->ts.type == BT_BOZ) + { + gfc_error ("A BOZ literal constant at %L cannot appear as an " + "actual argument in a function reference", + &arg->expr->where); + return false; + } temp = need_full_assumed_size; need_full_assumed_size = 0; -- cgit v1.1