https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77278
--- Comment #27 from Jan Hubicka <hubicka at ucw dot cz> --- > > I think that's reasonably easy to do for LTO. We'd want to keep > the default boolean_type_node size BOOLEAN_TYPEs separate but > can glob larger ones with integer types in the canonical type > merging. We can probably do the same in non-LTO but that might > not be required. Yes, we can glob other sizes of bool into integers and that should not affect non-fortran languages where truth comes in only one size. It would be bit inconsistent in a way that logical sized same way as C bool will bind to C _Bool type and others will bind to integer types of corresponding sizes. The Fortran 2003 language draft has section on interoperability of C and Fortran language: https://j3-fortran.org/doc/year/10/10-007.pdf Which says that fortran language C_BOOL should interoperate with _Bool. Why libgfortran API functions which dispatch into C code are not declared with C_BOOL rather than the integer sized logical? I wrote some testcases for LTO C and fortran types interoperatibility (gfortran.dg/lto/bind_c*) Since my Fortran-fu is limited, they may not be complete. It would be very useful to look into them and see if everything important is tested and also that we have testcase for all cases we want to support in addition to stadnard (like this one it seems) with some rationale in them for future reference. Honza