From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 40F98385BF99; Tue, 30 Nov 2021 14:38:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 40F98385BF99 From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/80548] -Wmaybe-uninitialized false positive when an assignment is added Date: Tue, 30 Nov 2021 14:38:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 6.3.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: aldyh at gcc dot gnu.org X-Bugzilla-Status: NEW 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 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: Tue, 30 Nov 2021 14:38:04 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D80548 --- Comment #5 from Aldy Hernandez --- (In reply to Aldy Hernandez from comment #4) > Created attachment 51908 [details] > untested patch >=20 > Like this. It fixes the problem at least for -O2. For -O1 y'all are on your own because there are no threaders smart enough to pick up the pattern. We'd need a threader at -O1 that runs after loop_done to pick it up: $ ./cc1 a.c -O1 -Wall -fenable-tree-threadfull2 -quiet cc1: note: enable pass tree-threadfull2 for functions in the range of [0, 4294967295] $=20 Voila, no warning. DOM3 runs after loop_done, so that would be candidate to handle this since = it threads at -O1. However, this won't happen in this release. It would requ= ire a converting DOM threading to a hybrid approach (and see if the custom copi= er can handle cross-loop threading), or convert it entirely to the backward threader (would require ranger handling floats).=