[ICE] overloading generic type bound functions in extended types

[ICE] overloading generic type bound functions in extended types

Hi,
following code

module foo
   implicit none

   type :: one
      contains
         procedure :: delete_with_int
         procedure :: delete_with_logical
         generic, public :: delete => delete_with_int, delete_with_logical
   end type

contains
   subroutine delete_with_int(this, i)
      implicit none
      class(one), intent(inout) :: this
      integer, intent(in) :: i
   end subroutine delete_with_int

   subroutine delete_with_logical(this, l)
      implicit none
      class(one), intent(inout) :: this
      logical, intent(in) :: l
   end subroutine delete_with_logical
      
end module foo
         
module bar
   use foo, only: one
   implicit none

   type, extends(one) :: two
   end type two
end module bar

module baz
   use bar, only: two
!   use foo, only: one
   implicit none

   type, extends(two) :: three
!   type, extends(one) :: three
      contains
         procedure :: delete_pure
         procedure :: delete_with_real
         generic, public :: delete => delete_pure, delete_with_real
   end type three

contains

   subroutine delete_pure(this)
      implicit none
      class(three), intent(inout) :: this
   end subroutine delete_pure

   subroutine delete_with_real(this, r)
      implicit none
      class(three), intent(inout) :: this
      real, intent(in) :: r
   end subroutine delete_with_real

end module baz

causes:

xarth@sandbox ~ $ ifort -c ice.f90
ice.f90: catastrophic error: **Internal compiler error: segmentation violation signal raised** 
Please report this error along with the circumstances in which it occurred in a Software Problem Report.  
Note: File and line given may not be explicit cause of this error.
compilation aborted for ice.f90 (code 1)

Please note that if type three extends directly type one ICE goes away.
Compiler used:

xarth@sandbox ~ $ ifort -V
Intel® Fortran Intel® 64 Compiler XE for applications running on Intel® 64, Version 12.1.5.339 Build 20120612
Copyright (C) 1985-2012 Intel Corporation.  All rights reserved.

Best regards,
Kacper Kowalik

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I've just noticed that importing module one in global scope of module three, also makes ICE go away. So this is probably duplicate of something I've already reported in the past. Nevertheless I'd be grateful if you could test it with upcoming release of ifort.
Thanks in advance,
Kacper Kowalik

Pretty sure this is the same as this earlier report from you.  It is fixed in our sources but I don't expect the fix to appear until a future release.

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today