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

MERGE(3f) produces ICE

ur
New Contributor II
1,260 Views

This works fine with ifort, but gets an ICE with  ifx (IFX) 2023.1.0 20230320

 

 

program demo_s2c
implicit none
character(len=*),parameter :: string='single string'
character(len=3),allocatable :: array(:)
integer :: i
! put one character into each 3-character element of array
array = [(string(i:i),i=1,len(string))]
! write array with ASCII Decimal Equivalent below it except show
! unprintable characters like NULL as "XXX"
write(*,'(1x,*("[",a3,"]":))') merge('XXX',array,iachar(array(:)(1:1)) < 32)
write(*,'(1x,*("[",i3,"]":))') iachar(array(:)(1:1))
end program demo_s2c

1 Solution
Barbara_P_Intel
Moderator
1,222 Views

Thanks for reporting this! I have good news! I compiled with an internal build of the next compiler and no ICE. This compiler is planned for release mid-year 2023.

This output matches what I get from ifort.

$ ifx demo_s2c.f90
$ a.out
 [s  ][i  ][n  ][g  ][l  ][e  ][   ][s  ][t  ][r  ][i  ][n  ][g  ]
 [115][105][110][103][108][101][ 32][115][116][114][105][110][103]

 

View solution in original post

0 Kudos
2 Replies
Barbara_P_Intel
Moderator
1,223 Views

Thanks for reporting this! I have good news! I compiled with an internal build of the next compiler and no ICE. This compiler is planned for release mid-year 2023.

This output matches what I get from ifort.

$ ifx demo_s2c.f90
$ a.out
 [s  ][i  ][n  ][g  ][l  ][e  ][   ][s  ][t  ][r  ][i  ][n  ][g  ]
 [115][105][110][103][108][101][ 32][115][116][114][105][110][103]

 

0 Kudos
Barbara_P_Intel
Moderator
1,047 Views

I just confirmed the ICE you reported is actually fixed in the compiler that will be available in the next few weeks as part of oneAPI 2023.2.

Be sure to check it out when it is available.



0 Kudos
Reply