public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/101304] New: Bind(C): CONTIGUOUS attribute not handled correctly in Fortran routines called from C with discontiguous argument
@ 2021-07-03  4:50 sandra at gcc dot gnu.org
  2021-10-21 19:07 ` [Bug fortran/101304] " sandra at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: sandra at gcc dot gnu.org @ 2021-07-03  4:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101304
           Summary: Bind(C): CONTIGUOUS attribute not handled correctly in
                    Fortran routines called from C with discontiguous
                    argument
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sandra at gcc dot gnu.org
  Target Milestone: ---

Section 18.3.6 of the Fortran 2018 standard says:

"When an interoperable Fortran procedure that is invoked from C has a dummy
argument with the CONTIGUOUS attribute or that is an assumed-length CHARACTER
explicit-shape or assumed-size array, and the actual argument is the address of
a C descriptor for a discontiguous object, the Fortran processor shall handle
the
difference in contiguity."

This is not working properly.  The bug is exposed by test cases
interoperability/contiguous-2.f90 and interoperability/contiguous-3.f90 from
the WIP TS29113 testsuite:

https://gcc.gnu.org/pipermail/gcc-patches/2021-July/574115.html

It looks like ftest1 is getting an array that starts at the correct offset of
the discontiguous section but has lost the non-unit sm from the base array.

Calling ftest1 and ftest2 directly from Fortran with a discontiguous array
section works correctly.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug fortran/101304] Bind(C): CONTIGUOUS attribute not handled correctly in Fortran routines called from C with discontiguous argument
  2021-07-03  4:50 [Bug fortran/101304] New: Bind(C): CONTIGUOUS attribute not handled correctly in Fortran routines called from C with discontiguous argument sandra at gcc dot gnu.org
@ 2021-10-21 19:07 ` sandra at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: sandra at gcc dot gnu.org @ 2021-10-21 19:07 UTC (permalink / raw)
  To: gcc-bugs

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

sandra at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from sandra at gcc dot gnu.org ---
Although it wasn't explicitly tagged with this issue, Tobias's recent big patch
to re-implement CFI <-> C descriptor conversions (commit
64f9623765da3306b0ab6a47997dc5d62c2ea261) fixed the testcases mentioned here
and removed the XFAILs on them, so I am marking this fixed.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-21 19:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-03  4:50 [Bug fortran/101304] New: Bind(C): CONTIGUOUS attribute not handled correctly in Fortran routines called from C with discontiguous argument sandra at gcc dot gnu.org
2021-10-21 19:07 ` [Bug fortran/101304] " sandra at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).