https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93498
--- Comment #5 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Thu, Feb 06, 2020 at 07:24:36AM +0000, tkoenig at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93498 > > --- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- > (In reply to kargl from comment #3) > > Patch is against svn r280157. > > > > Index: gcc/fortran/check.c > > =================================================================== > > --- gcc/fortran/check.c (revision 280157) > > +++ gcc/fortran/check.c (working copy) > > @@ -3942,6 +3942,10 @@ gfc_check_findloc (gfc_actual_arglist *ap) > > v1 = v->ts.type == BT_CHARACTER; > > if ((a1 && !v1) || (!a1 && v1)) > > goto incompat; > > + > > + /* Check the kind of the characters argument match. */ > > + if (a1 && v1 && a->ts.kind != v->ts.kind) > > + goto incompat; > > > > d = ap->next->next->expr; > > m = ap->next->next->next->expr; > > This avoids the ICE. > > What I have not yet have had time to figure out if the test case > is legal or not, if we need to convert or to reject. > It's not valid. F2018, 10.1.5.1, p. 154. The kind type parameters of the operands of a character relational intrinsic operation shall be the same. F2018, 16.9.78 VALUE shall be scalar and in type conformance with ARRAY, as specified in Table 10.2 for the operator == or the operator .EQV..