From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 02C543858402; Wed, 4 Oct 2023 01:46:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 02C543858402 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696383971; bh=omnp+oweTACEPSAtVG22D9/lEgbFWu5crdP2uq1vla4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=u2LJKi4kQCFTRu2l7Z8XF1d0pitpRXrp/IRj0RhZ3IBnaSmrDCmBOkxWUIP3IsvOH PWYdmLbs7zhlzOECXd5lj5IIaTPnwhEzC+O7MUQCJ5OMRJVJ/iQmAInlmWqmXi1WIn i2GHx/PJa5OKBtlkNmEh3AngbmFZoYRjnlbE0T70= From: "xry111 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/111669] bogus -Wnonnull in conditionally executed code Date: Wed, 04 Oct 2023 01:46:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: xry111 at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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=3D111669 --- Comment #2 from Xi Ruoyao --- (In reply to Xi Ruoyao from comment #1) > The warning given for the reduced test case is correct because it does not > make sense. It should be just rewritten as I mean, the code does not make sense. And the warning is given exactly because GCC is optimizing the strcpy call = to unreachable.=