From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C1C5F3858C62; Mon, 27 Feb 2023 10:31:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C1C5F3858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677493892; bh=suTi+2aJbeV2RF8B3rRrA5oTY8Ku5l/wQM6/wlTnQwM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Er3wsNfY8mwDHXp/VI42p1qwZBlLj9zOTcPMmyDU+4q3K64DrOGZTkDEmeQPAQ0+R iDpbzcOsHR+rl7f6DwJeWAdlLrlsL8RgeyHnkGb6uKNLB3sydQnL6ANQLsARgQx++m Uzx71YJdiydGCvagVGE4xMotha62IIoNDC5HYB2I= From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/108621] [12/13 regression]: bind(c) pointer array spurious maybe-uninitialized warning Date: Mon, 27 Feb 2023 10:31:30 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: resolution 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=3D108621 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #7 from Tobias Burnus --- Close as FIXED - and thanks to Michael for the report! On GCC 13 (mainline), only: * For intent(out), the pointless code is no longer produced and, thus, also the warning is gone. =E2=86=92 No backport to GCC 12 planned as this was only a bogus warning that ignored the "nullify()" - contrary to the generated code. * PR middle-end/108906 =E2=80=93 tracks the bogus warning with -O0 (gone wi= th optimization). Note: this message contains "may", i.e. the message is correct (even if the "may" never occurs). The issue still occurs with any intent but 'intent(out)' * The generated code is/was fine =E2=80=93 except possibly for the followin= g, but we cannot do anything about this with the current descriptors: =E2=80=93 For undefined pointers, which is valid* if no 'intent' is known at the caller side (and the pointer is not read in the called proc): Unless the pointer happens to point to NULL, the code will access unit memory and might even overflowing integer arithmetic. =E2=86=92 Should be usually still fine as long nothing is trapping or overf= lows are checked for with -fsanitize=3Dundefined. (And cannot be avoided.) [(*) it is also valid with 'intent(out)' but since the just committed patch, GCC 13 no longer generates affected code.]=