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
Neuer Beitragender II
1.946Aufrufe

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 Lösung
Barbara_P_Intel
Mitarbeiter
1.908Aufrufe

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]

 

Lösung in ursprünglichem Beitrag anzeigen

2 Antworten
Barbara_P_Intel
Mitarbeiter
1.909Aufrufe

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]

 

Barbara_P_Intel
Mitarbeiter
1.733Aufrufe

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.



Antworten