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

Nested SELECT TYPE and SELECT RANK constructs.

OP1
새로운 기여자 III
2,107 조회수

I get an access violation error with ifort 2021.9.0 ... and an ICE with ifx 2023.1.0 with the following code.

 

MODULE M
IMPLICIT NONE (TYPE, EXTERNAL)
CONTAINS

    SUBROUTINE S(X)
    IMPLICIT NONE (TYPE, EXTERNAL)
    CLASS(*) :: X(..)
    SELECT RANK (X)
        RANK (0)
            SELECT TYPE (XX => X)
                TYPE IS (INTEGER)
                    WRITE(*, *) 'X is of type INTEGER.'
            END SELECT 
    END SELECT
    END SUBROUTINE S

END MODULE M

PROGRAM P
USE M
IMPLICIT NONE (TYPE, EXTERNAL)
INTEGER :: I
CALL S(I)
END PROGRAM P

 

Either there is a missing check in the compiler to prevent those nested constructs, or this is a legal code but there is a compiler bug.

0 포인트
6 응답
FortranFan
명예로운 기여자 III
2,086 조회수

The code appears conformant, it looks like a bug in IFORT.

Intel team: FYI, IFX encounters ICE with this.

0 포인트
Ron_Green
중재자
2,075 조회수

we will get a bug report open.  Thanks for sending this to us! 

0 포인트
Ron_Green
중재자
1,989 조회수

bug ID is CMPLRLLVM-48814


0 포인트
Ron_Green
중재자
1,640 조회수

@OP1 this bug is fixed in the 2024.1.0 compiler.  I have just confirmed the fix in the released compiler.

0 포인트
riad_h_1
초보자
1,224 조회수

Hello,

For Mac Os users who can't benefit from new releases (ifort no longer maintained...), does anyone have a workaround for this problem?

0 포인트
Devorah_H_Intel
중재자
877 조회수

This issue has been fixed in the recently released Intel Fortran Compiler, available for download as part of Intel HPC Toolkit 2024.2.1

0 포인트
응답