Found when working on FINALization. It compiles with GCC 4.7 but fails with GCC 4.8 and 4.9. The following ICEs when passing an optional polymorphic array as argument to an optional dummy argument: finalize_12.f90:12:0: internal compiler error: in gfc_conv_class_to_class, at fortran/trans-expr.c:740 call foo_opt(xca=xca)!, xc, xaa, xca) ^ 0x63c6f9 gfc_conv_class_to_class(gfc_se*, gfc_expr*, gfc_typespec, bool, bool, bool, bool) ../../gcc/fortran/trans-expr.c:740 0x637b72 gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*, gfc_expr*, vec<tree_node*, va_gc, vl_embed>*) ../../gcc/fortran/trans-expr.c:4423 module m implicit none type t integer :: i end type t contains subroutine opt(xa, xc, xaa, xca) type(t), allocatable, intent(out), optional :: xa class(t), allocatable, intent(out), optional :: xc type(t), allocatable, intent(out), optional :: xaa(:) class(t), allocatable, intent(out), optional :: xca(:) call foo_opt(xca=xca)!, xc, xaa, xca) end subroutine opt subroutine foo_opt(xa, xc, xaa, xca) type(t), allocatable, intent(out), optional :: xa class(t), allocatable, intent(out), optional :: xc type(t), allocatable, intent(out), optional :: xaa(:) class(t), allocatable, intent(out), optional :: xca(:) end subroutine foo_opt end module m
The assert was added at revision 192495.
GCC 4.8.2 has been released.
Author: pault Date: Mon Nov 4 19:42:24 2013 New Revision: 204356 URL: http://gcc.gnu.org/viewcvs?rev=204356&root=gcc&view=rev Log: 2013-11-04 Paul Thomas <pault@gcc.gnu.org> PR fortran/57445 * trans-expr.c (gfc_conv_class_to_class): Remove spurious assert. 2013-11-04 Paul Thomas <pault@gcc.gnu.org> PR fortran/57445 * gfortran.dg/optional_class_1.f90 : New test Added: trunk/gcc/testsuite/gfortran.dg/optional_class_1.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-expr.c trunk/gcc/testsuite/ChangeLog
Author: pault Date: Sat Nov 30 10:58:42 2013 New Revision: 205549 URL: http://gcc.gnu.org/viewcvs?rev=205549&root=gcc&view=rev Log: 2013-11-30 Paul Thomas <pault@gcc.gnu.org> PR fortran/57445 * trans-expr.c (gfc_conv_class_to_class): Remove spurious assert. 2013-11-30 Paul Thomas <pault@gcc.gnu.org> PR fortran/57445 * gfortran.dg/optional_class_1.f90 : New test Added: branches/gcc-4_8-branch/gcc/testsuite/gfortran.dg/optional_class_1.f90 Modified: branches/gcc-4_8-branch/gcc/fortran/ChangeLog branches/gcc-4_8-branch/gcc/fortran/trans-expr.c branches/gcc-4_8-branch/gcc/testsuite/ChangeLog
Fixed on trunk and 4.8. Thanks for the report Paul