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

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

fridman__sergey
472 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.

 

 

1 Reply
Barbara_P_Intel
Employee
432 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
Reply