From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C3A593858C66; Sun, 15 Oct 2023 20:23:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C3A593858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697401389; bh=K+qweUbQPePKnfPxA3glkbJnxaR7Q7D7bqlY28c+ni0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hKIclVmdxuX/09jRA2DHVcBlzJBKjUOz7VJEuPwKXSWNrTcOOlGOvLuWLg6ruTF4l wFa/hX2G3ZtOie/YhOm2nUYVPmsWdxj8gsI3QftsKVQusj9nhI2/1unRQ9D2keS2HX uSeX0kDUIQ2+BWBEenuYNIJIup1K9UZ6aZwP/bAY= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/66969] Internal compiler error, segmentation fault Date: Sun, 15 Oct 2023 20:23:09 +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: 4.9.2 X-Bugzilla-Keywords: accepts-invalid, 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: cc keywords 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=3D66969 anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gcc dot gnu.org Keywords| |accepts-invalid --- Comment #4 from anlauf at gcc dot gnu.org --- We might need to tighten the check of restricted expressions: diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc index 663fe63dea6..6996e1e93d1 100644 --- a/gcc/fortran/expr.cc +++ b/gcc/fortran/expr.cc @@ -2849,6 +2852,21 @@ check_inquiry (gfc_expr *e, int not_restricted) && ap->expr->expr_type =3D=3D EXPR_VARIABLE && asym->attr.dummy && asym->attr.optional) return MATCH_NO; + + if (not_restricted =3D=3D 0 + && ap->expr->expr_type =3D=3D EXPR_VARIABLE + && !(asym->attr.flavor =3D=3D FL_PARAMETER) + && !asym->attr.dummy + && !asym->attr.in_common + && !asym->attr.use_assoc + && !asym->attr.host_assoc + && !asym->attr.implied_index + && (asym->attr.allocatable + || asym->attr.pointer + || (asym->as && asym->as->type =3D=3D AS_DEFERRED))) + { + return MATCH_ERROR; + } } return MATCH_YES; This needs to be refined further.=