From: Janus Weil Date: Sat, 11 Nov 2017 21:54:41 +0000 (+0100) Subject: re PR fortran/82932 ([OOP] ICE in update_compcall_arglist, at fortran/resolve.c:5837) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=859e3093a4c9248144be55391d4f37ba42533cd2;p=gcc.git re PR fortran/82932 ([OOP] ICE in update_compcall_arglist, at fortran/resolve.c:5837) 2017-11-11 Janus Weil PR fortran/82932 * resolve.c (update_compcall_arglist): Improve error recovery, remove a gcc_assert. 2017-11-11 Janus Weil PR fortran/82932 * gfortran.dg/typebound_call_29.f90: New test. From-SVN: r254660 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 1e4348db255..d766a4e56b6 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2017-11-11 Janus Weil + + PR fortran/82932 + * resolve.c (update_compcall_arglist): Improve error recovery, + remove a gcc_assert. + 2017-11-10 Fritz Reese PR fortran/82886 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 1dde0d3ce1a..28a0c9e74b0 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -5834,7 +5834,9 @@ update_compcall_arglist (gfc_expr* e) return true; } - gcc_assert (tbp->pass_arg_num > 0); + if (tbp->pass_arg_num <= 0) + return false; + e->value.compcall.actual = update_arglist_pass (e->value.compcall.actual, po, tbp->pass_arg_num, tbp->pass_arg); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d3e15cf7a00..4c739572756 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-11-11 Janus Weil + + PR fortran/82932 + * gfortran.dg/typebound_call_29.f90: New test. + 2017-11-10 Fritz Reese PR fortran/82886 diff --git a/gcc/testsuite/gfortran.dg/typebound_call_29.f90 b/gcc/testsuite/gfortran.dg/typebound_call_29.f90 new file mode 100644 index 00000000000..b07e67ff72c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_call_29.f90 @@ -0,0 +1,46 @@ +! { dg-do compile } +! +! PR 82932: [OOP] ICE in update_compcall_arglist, at fortran/resolve.c:5837 +! +! Contributed by Janus Weil + +module m + + implicit none + + type, abstract :: AT + contains + procedure(init_ifc), deferred :: sinit + procedure(missing_ifc), deferred :: missing + generic :: init => sinit + end type + + abstract interface + subroutine init_ifc(data) + import AT + class(AT) :: data + end subroutine + subroutine missing_ifc(data) + import AT + class(AT) :: data + end subroutine + end interface + +end module + + +program p + + use m + + implicit none + + type, extends(AT) :: ET ! { dg-error "must be ABSTRACT" } + contains + procedure :: sinit + end type + + type(ET) :: c + call c%init() + +end