Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
The Intel sign-in experience is changing in February to support enhanced security controls. If you sign in, click here for more information.
27557 Discussions

Getting error #5623 when declaring character length creating an array with array syntax

ur
New Contributor I
153 Views

Getting an error in several codes after upgrading to the latest ifort/ifx version, and do not see

this one in a search.  Is this one reported yet?

 

ifx (IFORT) 2023.0.0 20221201
Copyright (C) 1985-2022 Intel Corporation. All rights reserved.

subroutine sub1()
character(len=:),allocatable :: string
string='abcd'
write(*,'("[",a,"]")')[character(len=10) :: string]
end subroutine sub1

 

ifx -c sub1.f90

/opt/intel/oneapi/compiler/2023.0.0/linux/bin-llvm/xfortcom[0x1f563ca]
/opt/intel/oneapi/compiler/2023.0.0/linux/bin-llvm/xfortcom[0x1bef70e]
/opt/intel/oneapi/compiler/2023.0.0/linux/bin-llvm/xfortcom[0x1c55e52]
/opt/intel/oneapi/compiler/2023.0.0/linux/bin-llvm/xfortcom[0x1c55e26]
/opt/intel/oneapi/compiler/2023.0.0/linux/bin-llvm/xfortcom[0x1b69946]
:
:
/opt/intel/oneapi/compiler/2023.0.0/linux/bin-llvm/xfortcom[0x1b6f2d1]
/opt/intel/oneapi/compiler/2023.0.0/linux/bin-llvm/xfortcom[0x1b73215]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x14c43b213083]
/opt/intel/oneapi/compiler/2023.0.0/linux/bin-llvm/xfortcom[0x1982da9]

a.f90(4): error #5623: **Internal compiler error: internal abort** Please
report this error along with the circumstances in which it occurred in a
Software Problem Report. Note: File and line given may not be explicit
cause of this error.
write(*,'("[",a,"]")')[character(len=10) :: string]
-----------------------------------------------^
compilation aborted for a.f90 (code 3)

0 Kudos
1 Solution
Ron_Green
Moderator
103 Views

I will start a bug report for IFX.  thanks for bringing this example to us.

 

ron

View solution in original post

5 Replies
jimdempseyatthecove
Black Belt
135 Views

ICE is bad regardless of coding error.

Two experiments for you to do (and report back).

Replace your write with

write(*,'("[",a,"]")')(character(len=10) :: string) ! larger than len(string)

and

write(*,'("[",a,"]")')(character(len=2) :: string) ! smaller than len(string)

Note ()'s replacing []'s in both changes

 

Jim Dempsey

ur
New Contributor I
115 Views

Not sure what you mean about the () characters, as that is non-standard and causes an error with all compilers.

Runs fine with ifort and gfortran, anything specifying the LEN= parameter fails with ifx.  The actual codes (occurs in

a lot of existing code) has worked for years with ifort; gfortran; ... . Not sure about ifx.  The only thing that works with

ifx in the 2023 is the one with no LEN specified.  There are also, in the real codes, the same error with ifort, but not

in the same places, which is interesting.  This test runs fine with ifort, but gives the llvm traceback; so I guess ifort has moved

to the llvm.  To make room for the new 2023 install I had to delete the previous versions so do not have a previous ifx (or ifort) to

do any tests with, only have 2023 handy on my personal machine. The real codes do not involve WRITE statements; but when

trying to create a reproducer I found that the assignments and function calls were not required to reproduce the problem; just

using the syntax on a WRITE sufficed. If it was just ifx and not ifort producing the problems I could work around this, but it appears

in a lot of code and the new ifort is failing as well, as mentioned.

 

 

 

program testit
call sub1()
contains
subroutine sub1()
character(len=:),allocatable :: string
string='abcd'
#ifndef ifx
write(*,'("[",a,"]")')[character(len=10) :: string] ! larger than len(string)
write(*,'("[",a,"]")')[character(len=2) :: string] ! smaller than len(string)
write(*,'("[",a,"]")')[character(len=4) :: string] ! same len(string)
#endif
write(*,'("[",a,"]")')[string]
end subroutine sub1
end program testit

! gfortran output:

![abcd ]
![ab]
![abcd]
![abcd]
! ifort output:
![abcd ]
![ab]
![abcd]
![abcd]

Ron_Green
Moderator
104 Views

I will start a bug report for IFX.  thanks for bringing this example to us.

 

ron

Ron_Green
Moderator
99 Views

bug ID CMPLRLLVM-42916


ur
New Contributor I
98 Views

Thanks.  I want to start migrating to ifx; and this version comes close so far to compiling a large collection of code that runs with ifort; but this was a show-stopper for me.

Reply