[Bug fortran/92189] New: Fortran-written bind(C) function with allocatable argument does not update C descriptor on exit

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Oct 23 09:27:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92189

            Bug ID: 92189
           Summary: Fortran-written bind(C) function with allocatable
                    argument does not update C descriptor on exit
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: pault at gcc dot gnu.org
  Target Milestone: ---

Created attachment 47090
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47090&action=edit
Test case

Follow-up to PR 91863

For allocatable arguments, the allocation data can be updated at the end of the
program.  It probably also works with pointers. The ".data" component might be
undefined, but the shape has at least some value - it might not make sense, but
one does not dereference something which will cause invalid memory access.

The attached program shows that '.data' is okay after the call ("print *,
a(0:2)" shows the data), but the shape and the bounds are 0.


More information about the Gcc-bugs mailing list