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

            Bug ID: 85357
           Summary: Regression: gfortran versions 7.2.0/8.0.1 reject F03
                    procedure overriding
           Product: gcc
           Version: 8.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: c...@mnet-mail.de
  Target Milestone: ---

Created attachment 43913
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43913&action=edit
gfortran 7.2.0/8.0.1 error messages for above procedure overriding code

The following valid Fortran 2003 (sample) code, that uses subroutine 
overriding, fails to compile with both gfortran 7.2.0 and 8.0.1 versions,
but did compile with gfortran 7.1. 

It also compiles fine with PGI/Nvidia's pgfortran (17.4) and (LLVM-)flang
(6.0).

module base

   implicit none

   type, abstract :: base_type
   contains
      procedure :: summation
   end type base_type

contains

   subroutine summation(self,i,j)
      class(base_type) :: self
      integer(4), intent(in) :: i
      integer(4), intent(out) :: j
      j = i + 1
   end subroutine summation

end module base

module extended

   use base

   implicit none

   type, extends(base_type) :: extended_type
   contains
      procedure :: summation
   end type extended_type

contains

   subroutine summation(self,i,j)
      class(extended_type) :: self
      integer(4), intent(in) :: i
      integer(4), intent(out) :: j
      j = i + 2
   end subroutine summation

end module extended

Compiler error messages (identical for both gfortran versions) are attached 
as a separate file below.

gfortran Version 7.2.0 used is:

Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
7.2.0-1ubuntu1~16.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr
--with-gcc-major-version-only --program-suffix=-7
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib
--with-target-system-zlib --enable-objc-gc=auto --enable-multiarch
--disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 7.2.0 (Ubuntu 7.2.0-1ubuntu1~16.04) 


gfortran Version 8.0.1 used is:

Using built-in specs.
COLLECT_GCC=/home/kk/Gcc-8/bin/gfortran8
COLLECT_LTO_WRAPPER=/home/kk/Gcc-8/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --disable-checking
--enable-languages=c,c++,fortran --disable-multilib --enable-multiarch
--enable-shared --enable-threads=posix --program-suffix=8
--with-gmp=/usr/local/lib --with-mpc=/usr/lib --with-mpfr=/usr/lib
--without-included-gettext --with-system-zlib --with-tune=generic
--prefix=/home/kk/GCC-8
Thread model: posix
gcc version 8.0.1 20180409 (experimental) (GCC)

Reply via email to