IBM Support

LI77680: INTERNAL COMPILER ERROR WITH C_F_POINTER

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When compiling code that calls the C_F_POINTER procedure using
    an array result from an elemental function, the 'xlfhot'
    component of the compiler is encountering an internal error:
    
    $ cat test.f90
    PROGRAM test
      USE iso_c_binding, ONLY: c_ptr, c_loc, c_f_pointer
      TYPE mytype
        INTEGER :: a, b
      END TYPE mytype
      TYPE(mytype) :: bla(2)
      INTEGER, TARGET :: baz(100, 100)
      INTEGER, POINTER :: q(:, :)
      TYPE(c_ptr) :: p
    
      bla = mytype(100, 1)
      p = C_LOC(baz)
      CALL C_F_POINTER(p, q, getfirst(bla))
    CONTAINS
      ELEMENTAL FUNCTION getfirst(num) RESULT(a)
        TYPE(mytype), INTENT(in) :: num
        INTEGER :: a
        a = num%a
      END FUNCTION getfirst
    END PROGRAM test
    
    $ xlf2003 test.f90
    ** test   === End of Compilation 1 ===
    1585-100  Internal compiler error -- please contact your service
    representative. For more information visit:
    http://www.ibm.com/support/docview.wss?uid=swg21110810
    1501-511  Compilation failed for file test.f90.
    $
    

Local fix

  • Create a temporary array calling the elemental function, then
    pass the array to C_F_POINTER:
    
    
      temp = getfirst(bla)
      CALL C_F_POINTER(p, q, temp)
    

Problem summary

  • PROBLEM DESCRIPTION:
    An internal compiler error is encountered when C_F_POINTER is
    called and the shape argument is a non-primary expression.
    
    USERS AFFECTED:
    Users who call C_F_POINTER and pass an expression in as the
    shape argument.
    

Problem conclusion

  • The compiler now creates a temporary to store the result of the
    expression before passing it to C_F_POINTER.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI77680

  • 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:

    IV45207

  • 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