https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63667

            Bug ID: 63667
           Summary: ICE with DEFERRED procedure
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: valeryweber at hotmail dot com

Hi All

the following (wrong) piece of code is producing an ICE with gcc 4.9.1

v

cat cuba_types.F90
MODULE cubature_types
  IMPLICIT NONE
  PRIVATE
  TYPE, ABSTRACT :: cu_user_function_type
   CONTAINS
     PROCEDURE( cu_user_function_interface ), DEFERRED :: evaluate
  END TYPE cu_user_function_type

  ABSTRACT INTERFACE
     FUNCTION cu_user_function_interface ( this, r ) RESULT( reslt )
       IMPORT :: cu_user_function_type
       CLASS( cu_user_function_type ), INTENT( INOUT ) :: this
       REAL, DIMENSION( : ), INTENT( IN ) :: r
       REAL :: reslt
     END FUNCTION cu_user_function_interface
  END INTERFACE

  TYPE, PUBLIC :: cu_type
     PRIVATE
     LOGICAL :: init = .FALSE.
     CLASS( cu_user_function_type ) :: user_func
   CONTAINS
     PROCEDURE, PASS :: integrate => cu_integrate
  END TYPE cu_type

CONTAINS

  SUBROUTINE cu_integrate ( this )
    CLASS(cu_type), INTENT(INOUT)            :: this
    REAL, DIMENSION(3) :: r
    r = 1.0
    write(*,*) this%user_func%evaluate ( r )
  END SUBROUTINE cu_integrate

END MODULE cubature_types

gfortran-4.9.1 cuba_types.F90
cuba_types.F90:21.48:

     CLASS( cu_user_function_type ) :: user_func
                                                1
Error: Component 'user_func' with CLASS at (1) must be allocatable or pointer
f951: internal compiler error: in check_typebound_baseobject, at
fortran/resolve.c:5369
0x5bb9a8 check_typebound_baseobject
    ../../gcc-4.9.1/gcc/fortran/resolve.c:5369
0x5be5ce resolve_compcall
    ../../gcc-4.9.1/gcc/fortran/resolve.c:5656
0x5b4de2 resolve_typebound_function
    ../../gcc-4.9.1/gcc/fortran/resolve.c:5798
0x5b4de2 gfc_resolve_expr(gfc_expr*)
    ../../gcc-4.9.1/gcc/fortran/resolve.c:6107
0x5bf9ee gfc_resolve_code(gfc_code*, gfc_namespace*)
    ../../gcc-4.9.1/gcc/fortran/resolve.c:9804
0x5c124b gfc_resolve_blocks(gfc_code*, gfc_namespace*)
    ../../gcc-4.9.1/gcc/fortran/resolve.c:9021
0x5beac7 gfc_resolve_code(gfc_code*, gfc_namespace*)
    ../../gcc-4.9.1/gcc/fortran/resolve.c:9794
0x5c140e resolve_codes
    ../../gcc-4.9.1/gcc/fortran/resolve.c:14719
0x5c1317 resolve_codes
    ../../gcc-4.9.1/gcc/fortran/resolve.c:14705
0x5b2385 gfc_resolve
    ../../gcc-4.9.1/gcc/fortran/resolve.c:14747
0x5b2385 gfc_resolve(gfc_namespace*)
    ../../gcc-4.9.1/gcc/fortran/resolve.c:14733
0x5a76ea gfc_parse_file()
    ../../gcc-4.9.1/gcc/fortran/parse.c:5089
0x5e4ca5 gfc_be_parse_file
    ../../gcc-4.9.1/gcc/fortran/f95-lang.c:212
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

gfortran-4.9.1 --version
GNU Fortran (GCC) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.

Reply via email to