[Bug fortran/93498] [9/10 Regression] ICE in gfc_resolve_findloc, at fortran/iresolve.c:1844 since r9-3688-g01ce9e31a02c8039

tkoenig at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 6 07:25:00 GMT 2020


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.


More information about the Gcc-bugs mailing list