[Bug fortran/93714] [8/9/10 Regression] ICE in gfc_check_same_strlen, at fortran/check.c:1253
kargl at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Feb 12 19:33:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93714
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
Status|UNCONFIRMED |NEW
Last reconfirmed| |2020-02-12
CC| |kargl at gcc dot gnu.org
Ever confirmed|0 |1
Known to fail| |10.0, 8.3.1, 9.2.1
--- Comment #1 from kargl at gcc dot gnu.org ---
Diff is against svn r280157.
Index: gcc/fortran/check.c
===================================================================
--- gcc/fortran/check.c (revision 280157)
+++ gcc/fortran/check.c (working copy)
@@ -1244,8 +1244,14 @@ gfc_check_same_strlen (const gfc_expr *a, const gfc_ex
{
long len_a, len_b;
- len_a = gfc_var_strlen(a);
- len_b = gfc_var_strlen(b);
+ if ((a->ts.u.cl && a->ts.u.cl->length
+ && a->ts.u.cl->length->ts.type != BT_INTEGER)
+ || (b->ts.u.cl && b->ts.u.cl->length
+ && b->ts.u.cl->length->ts.type != BT_INTEGER))
+ return false;
+
+ len_a = gfc_var_strlen (a);
+ len_b = gfc_var_strlen (b);
if (len_a == -1 || len_b == -1 || len_a == len_b)
return true;
More information about the Gcc-bugs
mailing list