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

call to transfer with class(*) causes ICE in ifx, but works with ifort

ur
New Contributor II
724 Views

 

ifx_ice.f90(11): error #5623: **Internal compiler error: internal abort** Please report this error along with the circumstances in w
hich it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.
chars = transfer(any_scalar, chars)
-----------------------^
compilation aborted for ifx_ice.f90 (code 3)

! ifx (IFX) 2023.1.0 20230320
module m_any_scalar
   use, intrinsic :: iso_fortran_env, only: csz => character_storage_size
   implicit none
contains
   function any_scalar_to_bytes(any_scalar) result(chars)
      class(*), intent(in)          :: any_scalar
      character(len=1), allocatable :: chars(:)
      if (allocated(chars)) deallocate (chars)
      allocate (chars(storage_size(any_scalar)/csz))
      chars = transfer(any_scalar, chars)
   end function any_scalar_to_bytes
end module m_any_scalar
program main
use M_any_scalar, only : any_scalar_to_bytes
   write(*,'(*(z2.2))') any_scalar_to_bytes('1234567890')
   write(*,'(*(z2.2))') any_scalar_to_bytes(100)
   write(*,'(*(z2.2))') any_scalar_to_bytes(2.0+2.0)
end program main

 

1 Solution
Barbara_P_Intel
Moderator
684 Views

Congratulations! This ICE is fixed in a compiler that should be available at the end of the summer (in the northern hemisphere).

I don't know if this the same issue as the other thread. It's hard to know what goes on under the covers. But that one also is fixed in a compiler available later this year.

Thank you for reporting this!

 

 

View solution in original post

0 Kudos
5 Replies
martinmath
New Contributor I
704 Views

Looks like the same bug as reported in ICE-in-ifx-with-transfer-for-a-class-variable 

Barbara_P_Intel
Moderator
685 Views

Congratulations! This ICE is fixed in a compiler that should be available at the end of the summer (in the northern hemisphere).

I don't know if this the same issue as the other thread. It's hard to know what goes on under the covers. But that one also is fixed in a compiler available later this year.

Thank you for reporting this!

 

 

0 Kudos
Barbara_P_Intel
Moderator
529 Views

I just confirmed that the ICE with ifx is gone with the compiler that will be available in the next few weeks.

Is this the output you expect?



0 Kudos
ur
New Contributor II
522 Views

Could not find your output. I expect the program to produce the following three lines

 

 

 

31323334353637383930
64000000
00008040

0 Kudos
Barbara_P_Intel
Moderator
502 Views

My bad on not posting the output. I get the same thing.

31323334353637383930

64000000

00008040



0 Kudos
Reply