On 19.08.21 04:57, Sandra Loosemore wrote:
This is a follow-up to commit fef67987cf502fe322e92ddce22eea7ac46b4d75:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=fef67987cf502fe322e92ddce22eea7ac46b4d75
I realized last week that having multilib-specific versions of
ISO_Fortran_binding.h (generated by running the compiler to ask what
kinds it supports) was still broken outside of the test support; the
directory where it's being installed isn't on GCC's normal search
path. It seemed to me that it was better to try to find some other
solution for this problem than to venture down what appears to be a
rat hole.
I've come up with this patch to return to a single
ISO_Fortran_binding.h file that uses preprocessor magic to identify
the Fortran kind corresponding to the standard C long double type and
the GCC extension types __float128 and int128_t. I haven't attempted
to undo the follow-up patches that fixed in-tree testing; the static
.h file is still copied to the build directory, and it can still be
referenced with <> syntax during testing.
Any complaints about either the overall strategy here, or the logic to
infer the C type -> kind mapping? Or OK to commit?
OK.
[I think you need to fix the merge differences due to your
https://gcc.gnu.org/g:93b6b2f614eb692d1d8126ec6cb946984a9d01d7 commit
(regarding CFI_type_cfunptr) when applying the patch.]
I believe that, at some point, we still want to have a multi-lib include
directory, e.g. $(libsubdir)/include-multi/, for those include files
which have to be split per multi lib (+ update GCC's include search
paths). An example would be libgomp's omp.h (→
https://gcc.gnu.org/PR60670). However, that's a separate issue. If
that's available, we can then still decide whether the new solution of
__... feature tests is sufficient or whether it should be then changed
back to multiple include files.
In any case, this patch unbreaks https://sourceware.org/PR28183 which is
surely a good thing :-)
Thanks and sorry for the slow review.
Tobias
PS: One reason for the slow review was that I initially had planned to
include bits of ISO_Fortran_binding.h in the compiler FE for
constructing the CFI descriptor. However, the code started to be that
convoluted and additional #defines were needed. Thus, I have now simply
copied the definitions to gfortran.h + some hard-coded values in
trans-type.c, where the CFI type is constructed. – Thus, you patch does
not interfere with my CFI patch →
https://gcc.gnu.org/pipermail/gcc-patches/2021-September/578904.html
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634
München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas
Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht
München, HRB 106955