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

IFX Bug: Can not handle intrinsic transfer with infinitely polymorphic input.

Stijn_Schildermans
829 Views

IFX crashes when you try to call the intrinsic transfer function with as 'source' parameter an infinitely polymorphic variable. Minimal example below:

program main
   character(:), allocatable :: buffer
   integer :: v
   call transf_generic(v)
contains
   subroutine transf_generic(val)
       class(*), intent(in) :: val
       allocate(character(storage_size(val)/8) :: buffer)
       buffer = transfer(val, buffer)
   end subroutine
end program

This can be fixed by altering transf_generic in the above example in the following way:

subroutine transf_generic(val)
    class(*), intent(in) :: val

    allocate(character(storage_size(val)/8) :: buffer)
    select type (val)
       type is (integer)
          buffer = transfer(val, buffer)
    end select
end subroutine


Therefore it seems clear that the problem lies specifically in handling the generic nature of the input bitstring to the transfer function. 

 

 

0 Kudos
1 Solution
Barbara_P_Intel
Employee
805 Views

What version of ifx are you using? 

It compiles without error for me using ifx 2023.2.0. It was released as part of the oneAPI HPC Toolkit 2023.2 in mid-July.

 

View solution in original post

0 Kudos
2 Replies
Barbara_P_Intel
Employee
806 Views

What version of ifx are you using? 

It compiles without error for me using ifx 2023.2.0. It was released as part of the oneAPI HPC Toolkit 2023.2 in mid-July.

 

0 Kudos
Stijn_Schildermans
779 Views

I was using 2023.1.0. Must have installed a few days before the new version came out. Upgrading the compiler fixed the problem. Thanks  for the help and sorry for failing to check I had the newest version of IFX before posting..

Reply