From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8D16B385842E; Mon, 25 Apr 2022 23:36:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D16B385842E From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/104308] no location info provided for [-Wanalyzer-use-of-uninitialized-value] warnings Date: Mon, 25 Apr 2022 23:36:17 +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: 12.0 X-Bugzilla-Keywords: diagnostic, patch X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: WAITING 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 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: Mon, 25 Apr 2022 23:36:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104308 --- Comment #11 from CVS Commits --- The master branch has been updated by David Malcolm : https://gcc.gnu.org/g:a5dc2641add6b4f54086d40ae706fda3cdaac7f5 commit r12-8253-ga5dc2641add6b4f54086d40ae706fda3cdaac7f5 Author: David Malcolm Date: Mon Apr 25 19:34:33 2022 -0400 gimple-fold: fix further missing stmt locations [PR104308] PR analyzer/104308 initially reported about a -Wanalyzer-use-of-uninitialized-value diagnostic using UNKNOWN_LOCATION when complaining about certain memmove operations where the source is uninitialized. In r12-7856-g875342766d4298 I fixed the missing location for a stmt generated by gimple_fold_builtin_memory_op, but the reporter then found another way to generate such a stmt with UNKNOWN_LOCATION. I've now gone through gimple_fold_builtin_memory_op looking at all statement creation, and found three places in which a new statement doesn't have a location set on it (either directly via gimple_set_location, or indirectly via gsi_replace), one of which is the new reproducer. This patch adds a gimple_set_location to these three cases, and adds test coverage for one of them (the third hunk within the patch), fixing the new reproducer for PR analyzer/104308. gcc/ChangeLog: PR analyzer/104308 * gimple-fold.cc (gimple_fold_builtin_memory_op): Explicitly set the location of new_stmt in all places that don't already set i= t, whether explicitly, or via a call to gsi_replace. gcc/testsuite/ChangeLog: PR analyzer/104308 * gcc.dg/analyzer/pr104308.c: Add test coverage. Signed-off-by: David Malcolm =