]> git.ipfire.org Git - thirdparty/gcc.git/commit
libgfortran's ISO_Fortran_binding.c: Use GCC11 version for backward-only code [PR108056]
authorTobias Burnus <tobias@codesourcery.com>
Thu, 15 Dec 2022 11:25:07 +0000 (12:25 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Thu, 15 Dec 2022 11:26:06 +0000 (12:26 +0100)
commite205ec03f0794aeac3e8a89e947c12624d5a274e
treee211bec5bf44428c64577937c4b46c032debace6
parentc263c3eba8953c341cd8ac2d0a5f2b8f38623016
libgfortran's ISO_Fortran_binding.c: Use GCC11 version for backward-only code [PR108056]

Since GCC 12, the conversion between the array descriptors formats - the
internal (GFC) and the C binding one (CFI) - moved to the compiler itself
such that the cfi_desc_to_gfc_desc/gfc_desc_to_cfi_desc functions are only
used with older code (GCC 9 to 11).  The newly added checks caused asserts
as older code did not pass the proper values (e.g. real(4) as effective
argument arrived as BT_ASSUME type as the effective type got lost inbetween).

As proposed in the PR, revert to the GCC 11 version - known bugs is better
than some fixes and new issues. Still, GCC 12 is much better in terms of
TS29113 support and should really be used.

This patch uses the current libgomp version of the GCC 11 branch, except
it fixes the GFC version number (which is 0), uses calloc instead of malloc,
and sets the lower bound to 1 instead of keeping it as is for
CFI_attribute_other.

libgfortran/ChangeLog:

PR libfortran/108056
* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc,
gfc_desc_to_cfi_desc): Mostly revert to GCC 11 version for
those backward-compatiblity-only functions.
libgfortran/runtime/ISO_Fortran_binding.c
libgomp/testsuite/libgomp.fortran/allocate-4.f90 [new file with mode: 0644]