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

Compiler bug. Incorrect compilation when label is followed by the line-continuation (&) instruction

fridman__sergey
714 Views

I am using Windows OneAPI FORTRAN.

I encountered that incorrect compilation may occur for a code in which the label identifier is followed by spaces followed by the line continuation character (&) and the first token of the continuation line starts at the first position.


The attached program unit is designed to demonstrate the issue.

The attached file fails to compile with OneAPI compilers (tried IFORT and IFX versions 2024.0, 2023.2)

 

Older Intel compilers (I tried Intel Parallel Studio 2019) do not suffer from this problem.

 

Attempt to compile this file with Fortran Compiler 2023.2.1 triggers the following  output:

Compiling with Intel® Fortran Compiler 2023.2.1 [Intel(R) 64]...
continuation_bug.f90
C:\Console1\continuation_bug.f90(11): error #5274: Token incorrectly continued across lines
compilation aborted for C:\Console1\continuation_bug.f90 (code 1)

The offending lines of code are lines 10-11:

1   &
write(*,*)'Hello World 1'

 

The problem may mysteriously go away or come back after irrelevant changes in the code. For example, on my machine the compilation of this file succeeds if I uncomment line 5 of the attached code.

 

 

3 Replies
Barbara_P_Intel
Employee
674 Views

Thanks for reporting this with a good reproducer. It is a strange corner case. I filed a bug report, CMPLRLLVM-55158.

Great that you have a simple workaround!



0 Kudos
fridman__sergey
203 Views

I noticed that this case is posted as closed (updated 12/13/24)

Intel® Fortran Compiler06108613

 

I tested the issue with the most recent version of intel-fortran-compiler-2025.0.4.19 for Windows 64bit.

The problem still persist for both IFX and IFORT!

What "closed" status mean?

0 Kudos
Devorah_H_Intel
Moderator
168 Views

I checked case # CMPLRLLVM-55158 posted above, and it is still open internally. Once this case is fixed, an update will be posted to this forum.

0 Kudos
Reply