https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41227
Jan Hubicka <hubicka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org --- Comment #23 from Jan Hubicka <hubicka at gcc dot gnu.org> --- OK, I got here from discussion at https://gcc.gnu.org/ml/gcc-patches/2015-05/msg02577.html because I am trying to get the canonical type calculation to the more standard compliant shape. My reading of the standard is that the variable in question should be interoperable with int, not struct {int}, because I do not see any derived type in Fortran source. In that case it would be nice to make gfortran to just drop the struct for BIND(C) types if possible. Making this work on LTO level probably means to peel off single element struct/aggregate. Other variant is to simply punt those types to alias set 0. So in this case I would agree with Tobias, Comment #22, but this is my first even attempt to make sense of Fortran standard. As for legacy code, perhaps gfortran can propagate BIND(C) to middle-end (i.e. add type attribute "bind_c" to those types) and we could add a warning when fortran declaration of type !bind_c gets merged with non-fortran declaration in lto-symtab and hopefully help people to annotate their source codes.