From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8BC06385B833; Fri, 3 Apr 2020 14:12:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BC06385B833 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1585923175; bh=2nMevCawMBdQRkYERurYKGHdMXFNf4ibisrzquEPhYo=; h=From:To:Subject:Date:From; b=bTqbwY+J9XyPU+9xPo1D+C0/zmKE/lVuWk7/hpICnvd8youdkWEqNe+4hpSWPMqIW 5qPmb2SgDEqmwKjNkOGoctTnSjaWjNUz8qLXcRkKuu1Pra500XA8ByR51iKwpDnUE1 O3THNawDKU4fOJsC/xJsLa0LU8/bCpj7eV1ZKUMI= From: "lockywolf at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/94471] New: Calling a function pointer member of a polymorphic derived type returning a pointer produces an ICE (internal compiler error). Date: Fri, 03 Apr 2020 14:12:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 9.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: lockywolf at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2020 14:12:55 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94471 Bug ID: 94471 Summary: Calling a function pointer member of a polymorphic derived type returning a pointer produces an ICE (internal compiler error). Product: gcc Version: 9.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: lockywolf at gmail dot com Target Milestone: --- This is the code: program main type, abstract :: scheme_object end type scheme_object type, extends(scheme_object) :: scheme_primitive_procedure procedure(packageable_procedure), pointer, nopass :: proc_pointer end type scheme_primitive_procedure class(scheme_object), pointer :: exp abstract interface function packageable_procedure( argl, env ) result( retval ) import :: scheme_object class(scheme_object), pointer :: retval class(scheme_object), pointer :: argl class(scheme_object), pointer :: env end function packageable_procedure end interface contains function low_level_read( arg ) result( retval ) class(scheme_object), pointer :: retval class(scheme_object), pointer :: arg end function low_level_read subroutine main_loop() procedure(packageable_procedure), pointer :: proc class(scheme_object), pointer :: retval exp =3D> low_level_read( exp ) call ll_setup_global_environment() select type( proc_holder =3D> low_level_read(exp) ) type is (scheme_primitive_procedure) proc =3D> proc_holder%proc_pointer retval =3D> proc( exp, exp ) class default error stop "primitive procedure not a procedure" end select end subroutine main_loop end program produces: gfortran --save-temps -v -Wall -Wextra 2020-04-03-weird-gfortran-bug-2.f90 Driving: gfortran --save-temps -v -Wall -Wextra 2020-04-03-weird-gfortran-bug-2.f90 -l gfortran -l m -shared-libgcc Reading specs from /usr/lib64/gcc/x86_64-slackware-linux/9.3.0/specs COLLECT_GCC=3Dgfortran COLLECT_LTO_WRAPPER=3D/usr/libexec/gcc/x86_64-slackware-linux/9.3.0/lto-wra= pper Target: x86_64-slackware-linux Configured with: ../gcc-9.3.0/configure --prefix=3D/usr --libdir=3D/usr/lib= 64 --mandir=3D/usr/man --infodir=3D/usr/info --enable-shared --enable-bootstrap --enable-languages=3Dada,brig,c,c++,d,fortran,go,lto,objc,obj-c++ --enable-threads=3Dposix --enable-checking=3Drelease --enable-objc-gc --with-system-zlib --enable-libstdcxx-dual-abi --with-default-libstdcxx-abi= =3Dnew --disable-libstdcxx-pch --disable-libunwind-exceptions --enable-__cxa_atexit --disable-libssp --enable-gnu-unique-object --enable-plugin --enable-lto --disable-install-libiberty --enable-gnu-indirect-function --with-linker-hash-style=3Dgnu --with-gnu-ld --with-isl --verbose --with-arch-directory=3Damd64 --disable-gtktest --disable-werror --enable-clocale=3Dgnu --enable-multilib --target=3Dx86_64-slackware-linux --build=3Dx86_64-slackware-linux --host=3Dx86_64-slackware-linux Thread model: posix gcc version 9.3.0 (GCC)=20 COLLECT_GCC_OPTIONS=3D'-save-temps' '-v' '-Wall' '-Wextra' '-shared-libgcc' '-mtune=3Dgeneric' '-march=3Dx86-64' /usr/libexec/gcc/x86_64-slackware-linux/9.3.0/f951 2020-04-03-weird-gfortran-bug-2.f90 -quiet -dumpbase 2020-04-03-weird-gfortran-bug-2.f90 -mtune=3Dgeneric -march=3Dx86-64 -auxba= se 2020-04-03-weird-gfortran-bug-2 -Wall -Wextra -version -fintrinsic-modules-= path /usr/lib64/gcc/x86_64-slackware-linux/9.3.0/finclude -fpre-include=3D/usr/include/finclude/math-vector-fortran.h -o 2020-04-03-weird-gfortran-bug-2.s GNU Fortran (GCC) version 9.3.0 (x86_64-slackware-linux) compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.= 0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 GNU Fortran2008 (GCC) version 9.3.0 (x86_64-slackware-linux) compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.= 0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 2020-04-03-weird-gfortran-bug-2.f90:37:0: 37 | proc =3D> proc_holder%proc_pointer |=20 internal compiler error: in gfc_conv_component_ref, at fortran/trans-expr.c:2445 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The .i file has not been generated. The .s file only contains a single line: .file "2020-04-03-weird-gfortran-bug-2.f90"=