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

Bug when using OpenMP line continuation with conditional compilation sections

jjesse
Principiante
1.304 Vistas

I've been encountering a bug that causes a compiler error when using line continuation for OpenMP directives that are nested inside of !dec$ style conditional compilation sections. I'm seeing it when using ifx 2025.1, but the issue seems to have popped up in both ifort and ifx sometime during oneAPI 2024. A minimal reproducible example along with a CMake build script has been attached.

Although !dec$ sections are failing, using C-style #ifdefs appears to be okay.

The line continuation seems to cause the compiler to lose track of the conditional so that the compiler reports that it is not closed at the end:

XXXX/main-dec.f90(34): warning #5273: Directive found when statement continuation expected. Directive ignored.
!$omp partial_sum) shared(total_sum)
-----^
XXXX/main-dec.f90(35): warning #5273: Directive found when statement continuation expected. Directive ignored.
!dec$ endif
-----^
XXXX/main-dec.f90(58): error #5174: Unterminated conditional compilation directive
end program
-----------^

1 Responder
Devorah_H_Intel
Moderador
1.126 Vistas

Thank you for your report. I have escalated this issue to our compiler engineering. 

Responder