From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0FDC7385829D; Thu, 6 Oct 2022 20:58:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FDC7385829D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665089931; bh=x8e3WuHd0m3wf4SQgsjSRxee5ObbeVZoXRKgu6M0Avs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=A6BZFypdwxsOAvYy1Nyo8kUECFTBbU5mzT2sqaOR2w6UtCYNK2QWRGJUqtHLN2CQb TIo8pEfJpSbOSOgbMJQDnDJ2e9rS0u3bm7r3DeHWt0v5byFdcYY+SczZPgogk7Q5sz ZsSORyZTmmPM4+6TbbhH+qFOdFtpg0lAxSTIHslw= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/100971] ICE: Bad IO basetype (7) Date: Thu, 06 Oct 2022 20:58:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100971 --- Comment #3 from anlauf at gcc dot gnu.org --- Just from a purely technical point, the following would allow to trigger the proper check, as it allows to look into arrays, and regtests OK: diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc index d9d101775f6..bcf951ad756 100644 --- a/gcc/fortran/resolve.cc +++ b/gcc/fortran/resolve.cc @@ -10017,6 +10017,7 @@ resolve_transfer (gfc_code *code) if (exp =3D=3D NULL || (exp->expr_type !=3D EXPR_VARIABLE && exp->expr_type !=3D EXPR_FUNCTION + && exp->expr_type !=3D EXPR_ARRAY && exp->expr_type !=3D EXPR_STRUCTURE)) return; @@ -10030,6 +10031,7 @@ resolve_transfer (gfc_code *code) const gfc_typespec *ts =3D exp->expr_type =3D=3D EXPR_STRUCTURE || exp->expr_type =3D=3D EXPR_FUNCTION + || exp->expr_type =3D=3D EXPR_ARRAY ? &exp->ts : &exp->symtree->n.sym->ts; /* Go to actual component transferred. */ @@ -10128,6 +10130,9 @@ resolve_transfer (gfc_code *code) if (exp->expr_type =3D=3D EXPR_STRUCTURE) return; + if (exp->expr_type =3D=3D EXPR_ARRAY) + return; + sym =3D exp->symtree->n.sym; if (sym->as !=3D NULL && sym->as->type =3D=3D AS_ASSUMED_SIZE && exp->re= f=