https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117643
--- Comment #24 from kargls at comcast dot net --- (In reply to anlauf from comment #22) > (In reply to anlauf from comment #21) > > > diff --git a/gcc/fortran/iresolve.cc b/gcc/fortran/iresolve.cc > > index 580f8c8407d..759eb99a645 100644 > > --- a/gcc/fortran/iresolve.cc > > +++ b/gcc/fortran/iresolve.cc > > @@ -3192,6 +3200,7 @@ gfc_resolve_trim (gfc_expr *f, gfc_expr *string) > > { > > f->ts.type = BT_CHARACTER; > > f->ts.kind = string->ts.kind; > > + f->ts.is_c_interop = string->ts.is_c_interop; > > f->value.function.name = gfc_get_string ("__trim_%d", string->ts.kind); > > } > > This regtests OK but I am somewhat hesitant to propose to use it. There > are likely too many potential issues with default character vs. C_CHAR... I think that this is indeed the correct solution for trim(). But, I agree that we may have uncovered a nasty latent issue with kind('a') == kind(c_char_'a').