diff options
author | Janus Weil <janus@gcc.gnu.org> | 2017-11-11 22:54:41 +0100 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2017-11-11 22:54:41 +0100 |
commit | 859e3093a4c9248144be55391d4f37ba42533cd2 (patch) | |
tree | de5b9e49db3393a0b234550438eddfd3f4b3039a | |
parent | 6aab06c7450d1306b3ccf2aeb82882857df6446c (diff) | |
download | gcc-859e3093a4c9248144be55391d4f37ba42533cd2.zip gcc-859e3093a4c9248144be55391d4f37ba42533cd2.tar.gz gcc-859e3093a4c9248144be55391d4f37ba42533cd2.tar.bz2 |
re PR fortran/82932 ([OOP] ICE in update_compcall_arglist, at fortran/resolve.c:5837)
2017-11-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/82932
* resolve.c (update_compcall_arglist): Improve error recovery,
remove a gcc_assert.
2017-11-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/82932
* gfortran.dg/typebound_call_29.f90: New test.
From-SVN: r254660
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/typebound_call_29.f90 | 46 |
4 files changed, 60 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 1e4348d..d766a4e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2017-11-11 Janus Weil <janus@gcc.gnu.org> + + PR fortran/82932 + * resolve.c (update_compcall_arglist): Improve error recovery, + remove a gcc_assert. + 2017-11-10 Fritz Reese <fritzoreese@gmail.com> PR fortran/82886 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 1dde0d3..28a0c9e 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 d3e15cf..4c73957 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-11-11 Janus Weil <janus@gcc.gnu.org> + + PR fortran/82932 + * gfortran.dg/typebound_call_29.f90: New test. + 2017-11-10 Fritz Reese <fritzoreese@gmail.com> 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 0000000..b07e67f --- /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 <janus@gcc.gnu.org> + +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 |