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

Compiler bug

OP1
New Contributor III
865 Views

This was brought to my attention by a colleague. This code produces a randomly truncated output - and we think that the compiler should detect the interface inconsistency for S.

MODULE M
INTERFACE
    MODULE SUBROUTINE S(C)
    IMPLICIT NONE
    CHARACTER(LEN=:),ALLOCATABLE,INTENT(IN) :: C
    END SUBROUTINE S
END INTERFACE    
END MODULE M

SUBMODULE (M) SM
CONTAINS
    MODULE SUBROUTINE S(C)
    IMPLICIT NONE
    CHARACTER(LEN=*),ALLOCATABLE,INTENT(IN) :: C
    WRITE(*,*) C
    END SUBROUTINE S
END SUBMODULE SM

PROGRAM P
USE M
IMPLICIT NONE
CHARACTER(LEN=:),ALLOCATABLE :: STRING
STRING = 'Ha ha!'
CALL S(STRING)
END PROGRAM P

 

0 Kudos
3 Replies
Steve_Lionel
Honored Contributor III
865 Views

I agree - this is an error the compiler should catch. Please submit it to the Intel Online Service Center.

0 Kudos
OP1
New Contributor III
865 Views

Thanks - I did open a support ticket.

0 Kudos
Barbara_P_Intel
Employee
848 Views

This bug you reported where the compiler failed to detect the interface inconsistency in module/submodule has been fixed. The fix is available as part of PSXE 2020 update 2 (Fortran 19.1.2) that was released last month.

Please check it out!


0 Kudos
Reply