[Bug libfortran/101305] Bind(C): Problems with incorrect kinds/sizes in ISO_Fortran_binding.h and CFI_establish
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101305 --- Comment #9 from CVS Commits --- The master branch has been updated by Tobias Burnus : https://gcc.gnu.org/g:2ba0376ac40447ce7ee09fcef00511c18db25dfa commit r12-2839-g2ba0376ac40447ce7ee09fcef00511c18db25dfa Author: Tobias Burnus Date: Tue Aug 10 17:26:32 2021 +0200 gfortran: Fix in-build-tree testing [PR101305, PR101660] ISO_Fortran_binding.h is written in the build dir - hence, a previous commit added it as include directory for in-build-tree testing. However, it turned out that -I$specdir/libgfortran interferes with reading .mod files as they are then no longer regareded as intrinsic modules. Solution: Create an extra include/ directory in the libgfortran build dir and copy ISO_Fortran_binding.h to that directory. As -B$specdir/libgfortran already causes gfortran to read that include subdirectory, the -I flag is no longer needed. PR libfortran/101305 PR fortran/101660 PR testsuite/101847 libgfortran/ChangeLog: * Makefile.am (ISO_Fortran_binding.h): Create include/ in the build dir and copy the include file to it. (clean-local): Add for removing the 'include' directory. * Makefile.in: Regenerate. gcc/testsuite/ChangeLog: * lib/gfortran.exp (gfortran_init): Remove -I$specpath/libgfortran from the string used to set GFORTRAN_UNDER_TEST.
[Bug libfortran/101305] Bind(C): Problems with incorrect kinds/sizes in ISO_Fortran_binding.h and CFI_establish
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101305 --- Comment #8 from CVS Commits --- The master branch has been updated by Tobias Burnus : https://gcc.gnu.org/g:527a1cf32c27a3fbeaf6be7596241570d864cc4c commit r12-2808-g527a1cf32c27a3fbeaf6be7596241570d864cc4c Author: Tobias Burnus Date: Mon Aug 9 12:35:23 2021 +0200 testsuite/lib/gfortran.exp: Add -I for ISO*.h [PR101305, PR101660] This patch adds -I$specdir/libgfortran to GFORTRAN_UNDER_TEST, when set by proc gfortran_init. As the $specdir depends on the multilib setting, it has to be re-set for a different multilib; hence, we track whether a previous call to gfortran_init set that var or whether it was set differently. gcc/testsuite/ PR libfortran/101305 PR fortran/101660 * lib/gfortran.exp (gfortran_init): Add -I $specdir/libgfortran to GFORTRAN_UNDER_TEST; update it when set by previous gfortran_init call. * gfortran.dg/ISO_Fortran_binding_1.c: Use <...> not "..." for ISO_Fortran_binding.h's #include. * gfortran.dg/ISO_Fortran_binding_10.c: Likewise. * gfortran.dg/ISO_Fortran_binding_11.c: Likewise. * gfortran.dg/ISO_Fortran_binding_12.c: Likewise. * gfortran.dg/ISO_Fortran_binding_15.c: Likewise. * gfortran.dg/ISO_Fortran_binding_16.c: Likewise. * gfortran.dg/ISO_Fortran_binding_17.c: Likewise. * gfortran.dg/ISO_Fortran_binding_18.c: Likewise. * gfortran.dg/ISO_Fortran_binding_3.c: Likewise. * gfortran.dg/ISO_Fortran_binding_5.c: Likewise. * gfortran.dg/ISO_Fortran_binding_6.c: Likewise. * gfortran.dg/ISO_Fortran_binding_7.c: Likewise. * gfortran.dg/ISO_Fortran_binding_8.c: Likewise. * gfortran.dg/ISO_Fortran_binding_9.c: Likewise. * gfortran.dg/PR94327.c: Likewise. * gfortran.dg/PR94331.c: Likewise. * gfortran.dg/bind_c_array_params_3_aux.c: Likewise. * gfortran.dg/iso_fortran_binding_uint8_array_driver.c: Likewise. * gfortran.dg/pr93524.c: Likewise.
[Bug libfortran/101305] Bind(C): Problems with incorrect kinds/sizes in ISO_Fortran_binding.h and CFI_establish
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101305 sandra at gcc dot gnu.org changed: What|Removed |Added Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED --- Comment #7 from sandra at gcc dot gnu.org --- Fixed on trunk.
[Bug libfortran/101305] Bind(C): Problems with incorrect kinds/sizes in ISO_Fortran_binding.h and CFI_establish
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101305 --- Comment #6 from CVS Commits --- The master branch has been updated by Sandra Loosemore : https://gcc.gnu.org/g:a3b350f1799a1c0f9e2ece5b817a537fe42f0d2d commit r12-2553-ga3b350f1799a1c0f9e2ece5b817a537fe42f0d2d Author: Sandra Loosemore Date: Thu Jul 8 12:00:57 2021 -0700 Fix ISO_Fortran_binding.h paths in gfortran testsuite ISO_Fortran_binding.h is now generated in the libgfortran build directory where it is on the default include path. Adjust includes in the gfortran testsuite not to include an explicit path pointing at the source directory. 2021-07-27 Sandra Loosemore gcc/testsuite/ PR libfortran/101305 * gfortran.dg/ISO_Fortran_binding_1.c: Adjust include path. * gfortran.dg/ISO_Fortran_binding_10.c: Likewise. * gfortran.dg/ISO_Fortran_binding_11.c: Likewise. * gfortran.dg/ISO_Fortran_binding_12.c: Likewise. * gfortran.dg/ISO_Fortran_binding_15.c: Likewise. * gfortran.dg/ISO_Fortran_binding_16.c: Likewise. * gfortran.dg/ISO_Fortran_binding_17.c: Likewise. * gfortran.dg/ISO_Fortran_binding_18.c: Likewise. * gfortran.dg/ISO_Fortran_binding_3.c: Likewise. * gfortran.dg/ISO_Fortran_binding_5.c: Likewise. * gfortran.dg/ISO_Fortran_binding_6.c: Likewise. * gfortran.dg/ISO_Fortran_binding_7.c: Likewise. * gfortran.dg/ISO_Fortran_binding_8.c: Likewise. * gfortran.dg/ISO_Fortran_binding_9.c: Likewise. * gfortran.dg/PR94327.c: Likewise. * gfortran.dg/PR94331.c: Likewise. * gfortran.dg/bind_c_array_params_3_aux.c: Likewise. * gfortran.dg/iso_fortran_binding_uint8_array_driver.c: Likewise. * gfortran.dg/pr93524.c: Likewise.
[Bug libfortran/101305] Bind(C): Problems with incorrect kinds/sizes in ISO_Fortran_binding.h and CFI_establish
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101305 --- Comment #5 from CVS Commits --- The master branch has been updated by Sandra Loosemore : https://gcc.gnu.org/g:c4dc9f590181321c36d3f3ef72c50b3c47bbfe7c commit r12-2552-gc4dc9f590181321c36d3f3ef72c50b3c47bbfe7c Author: Sandra Loosemore Date: Thu Jul 8 16:38:14 2021 -0700 Bind(C): Correct sizes of some types in CFI_establish CFI_establish was failing to set the default elem_len correctly for CFI_type_cptr, CFI_type_cfunptr, CFI_type_long_double, and CFI_type_long_double_Complex. 2021-07-13 Sandra Loosemore libgfortran/ PR libfortran/101305 * runtime/ISO_Fortran_binding.c (CFI_establish): Special-case CFI_type_cptr and CFI_type_cfunptr. Correct size of long double on targets where it has kind 10.
[Bug libfortran/101305] Bind(C): Problems with incorrect kinds/sizes in ISO_Fortran_binding.h and CFI_establish
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101305 --- Comment #4 from CVS Commits --- The master branch has been updated by Sandra Loosemore : https://gcc.gnu.org/g:fef67987cf502fe322e92ddce22eea7ac46b4d75 commit r12-2551-gfef67987cf502fe322e92ddce22eea7ac46b4d75 Author: Sandra Loosemore Date: Thu Jul 8 08:21:20 2021 -0700 Bind(C): Fix type encodings in ISO_Fortran_binding.h ISO_Fortran_binding.h had many incorrect hardwired kind encodings in the definitions of the CFI_type_* macros. Additionally, not all targets support all the defined type encodings, and the Fortran standard requires those macros to have a negative value. This patch changes ISO_Fortran_binding.h to use sizeof instead of hard-coded sizes, and assembles it from fragments that reflect the set of types supported by the target. 2021-07-22 Sandra Loosemore Tobias Burnus libgfortran/ PR libfortran/101305 * ISO_Fortran_binding.h: Fix hard-coded sizes and split into... * ISO_Fortran_binding-1-tmpl.h: New file. * ISO_Fortran_binding-2-tmpl.h: New file. * ISO_Fortran_binding-3-tmpl.h: New file. * Makefile.am: Add rule for generating ISO_Fortran_binding.h. Adjust pathnames to that file. * Makefile.in: Regenerated. * mk-kinds-h.sh: New file. * runtime/ISO_Fortran_binding.c: Fix include path.
[Bug libfortran/101305] Bind(C): Problems with incorrect kinds/sizes in ISO_Fortran_binding.h and CFI_establish
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101305 --- Comment #3 from sandra at gcc dot gnu.org --- Patches posted: https://gcc.gnu.org/pipermail/fortran/2021-July/056236.html
[Bug libfortran/101305] Bind(C): Problems with incorrect kinds/sizes in ISO_Fortran_binding.h and CFI_establish
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101305 sandra at gcc dot gnu.org changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |sandra at gcc dot gnu.org --- Comment #2 from sandra at gcc dot gnu.org --- I'm working on patches for this.
[Bug libfortran/101305] Bind(C): Problems with incorrect kinds/sizes in ISO_Fortran_binding.h and CFI_establish
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101305 --- Comment #1 from sandra at gcc dot gnu.org --- There's also some overlap with PR 100917, relating to long double. Getting rid of the hard-coded kind/size assumptions will take care of at least the C side of that issue.