IBM Support

LI77717: INCORRECT OUTPUT FOR FORTRAN POINTER EXPRESSION AS ARGUMENT

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The following test case shows that XLF is mishandling function
    results as actual arguments when the result is a pointer with
    allocatable components.
    
    $cat reduced.f90
    MODULE MOD_NCLL
      IMPLICIT NONE
    
      TYPE INTERP_WEIGHTS
        INTEGER, allocatable :: INDEX(:)
      END TYPE INTERP_WEIGHTS
    
      TYPE NCFILE
        TYPE(INTERP_WEIGHTS),POINTER :: INTERP_C
      END TYPE NCFILE
    
    CONTAINS
    
    
      FUNCTION NCF_PLUS_NCF(NCF1, NCF2) RESULT(RET)
        IMPLICIT NONE
        TYPE(NCFILE), POINTER       :: NCF1
        TYPE(NCFILE), POINTER       :: NCF2
        type(NCFILE), POINTER       :: RET
    
        WRITE(0,*) '(debug NCF_PLUS_NCF)
    associated(NCF2)=',ASSOCIATED(NCF2)
    
        RET => NCF2
    
      END FUNCTION NCF_PLUS_NCF
    
      FUNCTION ZETA_FILE_OBJECT() RESULT(NCF)
        IMPLICIT NONE
        TYPE(NCFILE), POINTER :: NCF
    
        ALLOCATE(NCF)
        write(0,*) '(ZETA_FILE_OBJECT:
    associated(ncf)=',associated(ncf)
    
      END FUNCTION ZETA_FILE_OBJECT
    
    END MODULE MOD_NCLL
    
    
    PROGRAM test
      USE mod_ncll
      IMPLICIT NONE
    
      TYPE(NCFILE), POINTER :: NCF
      NCF => NCF_PLUS_NCF(NCF, ZETA_FILE_OBJECT() )
    
    END PROGRAM test
    
    
    xlf -O0 -g -qfullpath -qsuffix=cpp=f90 reduced.f90
    ** mod_ncll   === End of Compilation 1 ===
    ** test   === End of Compilation 2 ===
    1501-510  Compilation successful for file reduced.f90.
    $./a.out
     (ZETA_FILE_OBJECT: associated(ncf)= T
     (debug NCF_PLUS_NCF) associated(NCF2)= F
    

Local fix

  • Change    INTEGER, allocatable :: INDEX(:)
    to  INTEGER, POINTER :: INDEX(:)
    

Problem summary

  • PROBLEM DESCRIPTION: When a pointer function result with
    allocatable components is passed to another procedure as actual
    argument, compiler may generate incorrect code while loading
    the address of the argument. User application may produce
    incorrect results due to this problem.
    
    USERS AFFECTED: Users passing pointer function results with
    allocatable components as actual arguments will see this
    problem.
    

Problem conclusion

  • The problem has been fixed. Apply applicable service.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI77717

  • Reported component name

    XL FORTRAN FOR

  • Reported component ID

    5799AH100

  • Reported release

    E10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-11-26

  • Closed date

    2013-11-26

  • Last modified date

    2013-11-26

  • APAR is sysrouted FROM one or more of the following:

    IV47327

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    XL FORTRAN FOR

  • Fixed component ID

    5799AH100

Applicable component levels

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SS2MB5","label":"XL Fortran for Blue Gene\/Q"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"ALL VERSIONS","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
26 November 2013