Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Internal Compiler Error

OP1
New Contributor III
521 Views
The following code produces an ICE with IVF 10.1.3885.2005. This may have been fixed in newer releases, but I cannot test if it's still there - maybe it's worth checking.

If you comment the EXIT statement the ICE disappears.

Olivier

[fortran]PROGRAM MAIN
IMPLICIT NONE

LOGICAL :: KEEP_GOING
INTEGER :: I,IMAX,J,JMAX,STATUS

KEEP_GOING = .TRUE.
IMAX = 10
JMAX = 10

DO I=1,IMAX
    !$OMP PARALLEL NUM_THREADS(4) DEFAULT(SHARED) PRIVATE(J,STATUS)
    !$OMP DO
    DO J=1,JMAX
        IF (KEEP_GOING) THEN
            STATUS = I+J
            IF (STATUS>10) THEN
               !$OMP CRITICAL (LOCK)
                   KEEP_GOING = .FALSE.
               !$OMP END CRITICAL (LOCK)
            END IF
        ELSE
            EXIT
        END IF
    END DO
    !$OMP END DO NOWAIT
    !$OMP END PARALLEL
    IF (.NOT.KEEP_GOING) EXIT
END DO    

END PROGRAM MAIN[/fortran]
0 Kudos
1 Reply
Steven_L_Intel1
Employee
521 Views
Current version says:

t.f90(23): error #7566: A RETURN or EXIT statement is not legal in a DO loop associated with a parallel directive.
EXIT
------------^

No ICE.
0 Kudos
Reply