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

    IV49428

  • Reported component name

    XL FORTRAN FOR

  • Reported component ID

    5725C7400

  • Reported release

    E10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-09-18

  • Closed date

    2013-09-18

  • Last modified date

    2013-09-20

  • 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

    5725C7400

Applicable component levels

  • RE10 PSY U861038

       UP C



Rate this page:

(0 users)Average rating

Document information


More support for:

XL Fortran for AIX
Compiler

Software version:

14.1

Reference #:

IV49428

Modified date:

2013-09-20

Translate my page

Machine Translation

Content navigation