From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E654B38768BE; Wed, 29 Mar 2023 18:19:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E654B38768BE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680113946; bh=0sktsLOn42i/yC0BG7jM8YPSNGRge+yGrfktfhs9QIo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qAo6jWTRN4HhOB3jQ9OngfBvLPbl6aramgZO+5e+hutrU+LwePoeu99raZPZiG6A/ EU6P6mDUrDcqISaTLP2Byer0aLsYSw6PVzvDLepgEi0Iv/1gdQiEGDHJ39wiIIJteq ipaSDgtVf6aoxUf4qqPTcRMATRy5+ZctjKrWoLlk= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/108733] -Wanalyzer-use-of-uninitialized-value false positives seen with __attribute__((cleanup)) Date: Wed, 29 Mar 2023 18:19:06 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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: 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=3D108733 --- Comment #3 from CVS Commits --- The releases/gcc-12 branch has been updated by David Malcolm : https://gcc.gnu.org/g:98558117ba870d47398927f2066e469e47f39c16 commit r12-9365-g98558117ba870d47398927f2066e469e47f39c16 Author: David Malcolm Date: Wed Mar 29 14:16:49 2023 -0400 analyzer: fix further overzealous state purging [PR108733] PR analyzer/108733 reports various false positives in qemu from -Wanalyzer-use-of-uninitialized-value with __attribute__((cleanup)) at -O1 and above. Root cause is that the state-purging code was failing to treat: _25 =3D MEM[(void * *)&val]; as a usage of "val", leading to it erroneously purging the initialization of "val" along an execution path that didn't otherwise use "val", apart from the __attribute__((cleanup)). Fixed thusly. Integration testing on the patch show this change in the number of diagnostics: -Wanalyzer-use-of-uninitialized-value coreutils-9.1: 18 -> 16 (-2) qemu-7.2.0: 87 -> 80 (-7) where all that I investigated appear to have been false positives, hence an improvement. Cherrypicked from r13-5745-g77bb54b1b07add. gcc/analyzer/ChangeLog: PR analyzer/108733 * state-purge.cc (get_candidate_for_purging): Add ADDR_EXPR and MEM_REF. gcc/testsuite/ChangeLog: PR analyzer/108733 * gcc.dg/analyzer/torture/uninit-pr108733.c: New test. Signed-off-by: David Malcolm =