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

            Bug ID: 99045
           Summary: In select rank, compiler error for call to type-bound
                    procedure.
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gustav.r.jansen at gmail dot com
  Target Milestone: ---

Created attachment 50159
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50159&action=edit
Source code for reproducer

The attached code fails to compile when a type-bound procedure is called within
a select rank block.

The compiler gives the following output:

/home/software/gcc/10.2.0/bin/gfortran -v -save-temps -Wall -Wextra
-fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations
-fsanitize=undefined -c main.f90
Using built-in specs.
COLLECT_GCC=/home/software/gcc/10.2.0/bin/gfortran
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-10.2.0/configure --prefix=/home/software/gcc/10.2.0
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Wall' '-Wextra' '-fno-strict-aliasing'
'-fwrapv' '-fno-aggressive-loop-optimizations' '-fsanitize=undefined' '-c'
'-mtune=generic' '-march=x86-64'
 /home/software/gcc/10.2.0/libexec/gcc/x86_64-pc-linux-gnu/10.2.0/f951 main.f90
-quiet -dumpbase main.f90 -mtune=generic -march=x86-64 -auxbase main -Wall
-Wextra -version -fno-strict-aliasing -fwrapv
-fno-aggressive-loop-optimizations -fsanitize=undefined
-fintrinsic-modules-path
/home/software/gcc/10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/finclude -o main.s
GNU Fortran (GCC) version 10.2.0 (x86_64-pc-linux-gnu)
        compiled by GNU C version 10.2.0, GMP version 6.1.0, MPFR version
3.1.4, MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran2008 (GCC) version 10.2.0 (x86_64-pc-linux-gnu)
        compiled by GNU C version 10.2.0, GMP version 6.1.0, MPFR version
3.1.4, MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
main.f90:21:43:

   21 |             call t%do_something_in_a_type()
      |                                           1
Error: ‘do_something_in_a_type’ at (1) is not a function

Reply via email to