[Bug fortran/66493] ICE on alternate return argument for typebound procedure

gerhard.steinmetz.fortran@t-online.de gcc-bugzilla@gcc.gnu.org
Thu Jun 11 08:05:00 GMT 2015


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

--- Comment #7 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
Interestingly, there are some tests in the test suite already,
especially altreturn_3.f90 and altreturn_8.f90.

The latter is using a nopass attribute and compiles.
It still should be tested with some real runtime tests, as yours.

Some of the following constructed tests fail to compile.


$ cat zarc1_1.f90
module m
   implicit none
   type t
   contains
      procedure :: s1
      procedure :: s2
      generic :: s => s1, s2
   end type
contains
   subroutine s1(*)
   end
   subroutine s2(*, *)
   end
end module


$ cat zarc1_2_pass.f90
module m
   implicit none
   type t
   contains
      procedure, pass :: s1
      procedure, pass :: s2
      generic :: s => s1, s2
   end type
contains
   subroutine s1(*)
   end
   subroutine s2(*, *)
   end
end module


$ cat zarc1_3_nopass.f90
module m
   implicit none
   type t
   contains
      procedure, nopass :: s1
      procedure, nopass :: s2
      generic :: s => s1, s2
   end type
contains
   subroutine s1(*)
   end
   subroutine s2(*, *)
   end
end module



$ cat zarcg_1.f90
module m
   implicit none
   type t
   contains
      procedure :: s1
      procedure :: s2
      procedure :: s3
      generic :: s => s1, s2, s3
   end type
contains
   subroutine s1(x)
      class(t) :: x
   end
   subroutine s2(x, *)
      class(t) :: x
   end
   subroutine s3(x, *, *)
      class(t) :: x
   end
end module


$ cat zarcg_2_pass.f90
module m
   implicit none
   type t
   contains
      procedure, pass :: s1
      procedure, pass :: s2
      procedure, pass :: s3
      generic :: s => s1, s2, s3
   end type
contains
   subroutine s1(x)
      class(t) :: x
   end
   subroutine s2(x, *)
      class(t) :: x
   end
   subroutine s3(x, *, *)
      class(t) :: x
   end
end module


$ cat zarcg_3_nopass.f90
module m
   implicit none
   type t
   contains
      procedure, nopass :: s1
      procedure, nopass :: s2
      procedure, nopass :: s3
      generic :: s => s1, s2, s3
   end type
contains
   subroutine s1(x)
      class(t) :: x
   end
   subroutine s2(x, *)
      class(t) :: x
   end
   subroutine s3(x, *, *)
      class(t) :: x
   end
end module



More information about the Gcc-bugs mailing list