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

Another bug with ASSOCIATED?

OP1
New Contributor III
592 Views

This code illustrates another potential bug when CLASS, POINTER, and ASSOCIATED are mixed together. With the latest ifort and ifx the association status of CT changes after the call to S - I believe it should not.

PROGRAM P
IMPLICIT NONE

TYPE :: T
END TYPE T
CLASS(T), POINTER :: CT => NULL()

WRITE(*, *) 'Association status of CT: ', ASSOCIATED(CT)

CALL S(CT, NULL())
WRITE(*, *) 'Association status of CT: ', ASSOCIATED(CT)

CONTAINS
    SUBROUTINE S(C, D)
    IMPLICIT NONE
    CLASS(T), POINTER, INTENT(INOUT) :: C
    TYPE(T), POINTER, INTENT(IN) :: D
    C => D
    END SUBROUTINE S
END PROGRAM P

.

 

2 Replies
Devorah_H_Intel
Moderator
467 Views

I was able to test this issue internally. It has now been escalated to compiler engineering for a fix. Thank you for reporting this to us. 


0 Kudos
Devorah_H_Intel
Moderator
75 Views

This issue is fixed in the 2025.1 ifx.

0 Kudos
Reply