From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 50DB23858D32; Thu, 2 Nov 2023 17:56:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 50DB23858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698947778; bh=Wwa+2I42X1GsYsHGQxW6QP7hRccvG85iZyBI1kXlGMw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jVEd82WE6ZtDO9cgHZ4JJGWTP3n56IbPOLgCfNWkqwy1Z+unJE7jJ9Xqw6THzd74n 0fHUPSiESWaVbSNLBS88AFtEhZ/OSbzp5lxSpgz0p6eOGZat1P8bj9K+Fq6ZDDNOWt t23J7vaGxnT01Kmg8f82H+zKgTANR/wS9jjnsEnk= From: "pault at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/112316] [13 Regression] Fix for PR87477 rejects valid code with a bogus error about pointer assignment and causes an ICE since r13-7761-gd6997a5aab7aaa325946a6283bfee8ac2bd9f540 Date: Thu, 02 Nov 2023 17:56:17 +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: 13.2.1 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: pault at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on everconfirmed bug_status 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=3D112316 Paul Thomas changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2023-11-02 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #1 from Paul Thomas --- I can confirm this bug, of course. Thanks for the report. I temporary work around is to invert the order of the contained procedures. The problem is caused by a stupid (on my part :-( ) oversight: diff --git a/gcc/fortran/parse.cc b/gcc/fortran/parse.cc index e103ebee557..f88f9be3be8 100644 --- a/gcc/fortran/parse.cc +++ b/gcc/fortran/parse.cc @@ -5196,7 +5196,7 @@ parse_associate (void) } } - if (target->rank) + if (1) { int rank =3D 0; rank =3D target->rank; fixes the problem and regtests OK. The simplification that I effected with the offending patch has been comple= tely spoiled by forgetting that one of the cases that was supposed to be fixed in the block following the condition above is that of target->rank =3D 0 and t= he associate variable having an array_spec. I will commit a cleaned up version as obvious first thing tomorrow morning. Sorry for the inconvenience. Paul=