Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28446 Discussions

[ICE] overloading generic type bound functions in extended types

Kacper_Kowalik
Beginner
359 Views
Hi,
following code
[fortran]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[/fortran]
causes:
[bash]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)[/bash]
Please note that if type three extends directly type one ICE goes away.
Compiler used:
[bash]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.[/bash]
Best regards,
Kacper Kowalik
0 Kudos
2 Replies
Kacper_Kowalik
Beginner
359 Views
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
0 Kudos
Steven_L_Intel1
Employee
359 Views
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.
0 Kudos
Reply