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
新分销商 II
1,502 次查看

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 解答
Barbara_P_Intel
1,464 次查看

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 项奖励
2 回复数
Barbara_P_Intel
1,465 次查看

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 项奖励
Barbara_P_Intel
1,289 次查看

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 项奖励
回复