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.

Compiler bug

OP1
New Contributor III
1,100 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
1,100 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
1,100 Views

Thanks - I did open a support ticket.

0 Kudos
Barbara_P_Intel
Employee
1,083 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