From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C820A385843B; Thu, 9 May 2024 17:12:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C820A385843B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715274731; bh=qvrcD3sAmvIaGbTf45N1/BGOiCZ70reQtF6RHj3RE+Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=D6UfIblsvL6+FjepfTBWPQdBdGCuAtX0mlcLJYoylmNXwQ17DSgBEikY0P2TJfopn 06Zsm5mHjIbIRAw33/q7x5KSygCZo/hW5NTL5xMmukDVDG8WunXHqgalMK/7A3FTEB qjnaW61zMK1QevRpito4jTntbyU/+3Z1/00IjTfA= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/113253] [11/12/13 Regression] gcc -g causes -fanalyzer to issue false positive Date: Thu, 09 May 2024 17:12:04 +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.2.1 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: 11.5 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=3D113253 --- Comment #5 from GCC Commits --- The releases/gcc-13 branch has been updated by David Malcolm : https://gcc.gnu.org/g:2c688f6afce4cbb414f5baab1199cd525f309fca commit r13-8754-g2c688f6afce4cbb414f5baab1199cd525f309fca Author: David Malcolm Date: Thu May 9 13:09:30 2024 -0400 analyzer: fix skipping of debug stmts [PR113253] PR analyzer/113253 reports a case where the analyzer output varied with and without -g enabled. The root cause was that debug stmts were in the FOR_EACH_IMM_USE_FAST list for SSA names, leading to the analyzer's state purging logic differing between the -g and non-debugging cases, and thus leading to differences in the exploration of the user's code. Fix by skipping such stmts in the state-purging logic, and removing debug stmts when constructing the supergraph. gcc/analyzer/ChangeLog: PR analyzer/113253 * region-model.cc (region_model::on_stmt_pre): Add gcc_unreacha= ble for debug statements. * state-purge.cc (state_purge_per_ssa_name::state_purge_per_ssa_name): Skip any debug stmts in the FOR_EACH_IMM_USE_FAST list. * supergraph.cc (supergraph::supergraph): Don't add debug stmts to the supernodes. gcc/testsuite/ChangeLog: PR analyzer/113253 * gcc.dg/analyzer/deref-before-check-pr113253.c: New test. (cherry picked from commit r14-8670-gcc7aebff74d896) Signed-off-by: David Malcolm =