Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

Compiler bug

OP1
New Contributor I
210 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
Black Belt Retired Employee
210 Views

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

OP1
New Contributor I
210 Views

Thanks - I did open a support ticket.

Barbara_P_Intel
Moderator
193 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!


Reply