From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AF4B13857C71; Fri, 7 Jan 2022 22:46:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF4B13857C71 From: "dmalcolm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/102692] -Wanalyzer-null-dereference false alarm with (!p || q || !p->next) Date: Fri, 07 Jan 2022 22:46:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: analyzer X-Bugzilla-Version: 11.2.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: dmalcolm at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2022 22:46:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102692 David Malcolm changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2022-01-07 Ever confirmed|0 |1 Status|UNCONFIRMED |ASSIGNED --- Comment #2 from David Malcolm --- Thanks for filing this. With trunk (for gcc 12) I see the false positive f= rom comment #1, and also this false positive (new warning in gcc 12): ../../src/gcc/testsuite/gcc.dg/analyzer/pr102692.c:82:20: warning: use of uninitialized value =E2=80=98end=E2=80=99 [CWE-457] [-Wanalyzer-use-of-unin= itialized-value] 82 | if (!tail || end < prev || !tail->next) /* { dg-bogus "use of uninitialized value 'end'" "uninit" } */ | ~~~~^~~~~~ =E2=80=98fix_overlays_before=E2=80=99: events 1-3 | | 75 | while (tail | | ~~~~ | 76 | && (tem =3D make_lisp_ptr (tail, 5), | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (1) following =E2=80=98false=E2=80=99 branch (when = =E2=80=98tail=E2=80=99 is NULL)... | 77 | (end =3D marker_position (XOVERLAY (tem)->end)) >= =3D pos)) | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~ |...... | 82 | if (!tail || end < prev || !tail->next) /* { dg-bogus "use of uninitialized value 'end'" "uninit" } */ | | ~~~~~ ~~~~~~~~~~ | | | | | | | (3) use of uninitialized value =E2=80=98end= =E2=80=99 here | | (2) ...to here | Am investigating.=