[Bug fortran/89384] [9 Regression] CONTIGUOUS dummy argument in BIND(C) interface incorrect when actual is non-contiguous
tkoenig at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Feb 18 20:49:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89384
Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pault at gcc dot gnu.org
--- Comment #2 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
I did a bit more of bisecting, and it seems that r267881 is the one.
With that revision, the tree dump shows
ctg (struct array01_real(kind=4) & restrict x)
{
integer(kind=8) ubound.0;
integer(kind=8) stride.1;
integer(kind=8) offset.2;
integer(kind=8) size.3;
real(kind=4)[0:D.2275] * restrict x.0;
[...]
_gfortran_gfc_desc_to_cfi_desc (&cfi.11, &parm.10);
ctg (cfi.11);
_gfortran_cfi_desc_to_gfc_desc (&parm.10, &cfi.11);
whereas at r267880 we get
ctg (struct array01_real(kind=4) & restrict x)
{
integer(kind=8) ubound.0;
integer(kind=8) stride.1;
[...]
D.2290 = _gfortran_internal_pack (&parm.10);
parm.10.data = D.2290;
ctg (&parm.10);
parm.10.data = origptr.11;
if ((real(kind=4)[0:] *) parm.10.data != (real(kind=4)[0:] *) D.2290)
{
_gfortran_internal_unpack (&parm.10, D.2290);
__builtin_free (D.2290);
}
}
so it seems the pack/unpack is missing. I'm also fairly
sure that the previous code would not have worked together with C
in the absence of ISO_Fortran_binding.h :-)
More information about the Gcc-bugs
mailing list