From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CA60C3858404; Wed, 31 Aug 2022 13:44:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA60C3858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661953440; bh=YBZPCwJRetboZk/dWOybF0kVA8XfkdG4ni4TlYwlL8w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pv+KciH34it3tsepI2G01SS+GT9qzwc8IIFxjTOszK+B0cb1moTTCsxRCKRR6qWKF HKnS+GThdhryFKp0kEwAv0SWwvG73Vg6CDlqWLpCUfCmpWcy/87HIJIJQqWE+FuFXZ sEN9Dd+YK/6aDNYoaSAdle1fGE78DK1Z7IlznwPA= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/93432] variable is used uninitialized, but gcc shows no warning Date: Wed, 31 Aug 2022 13:44:00 +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: 9.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: component keywords 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=3D93432 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Component|c |tree-optimization Keywords|easyhack | --- Comment #7 from Richard Biener --- It works by chance when optimizing but not optimizing too much. -O3 unrolls the loop and runs into CCP aka PR18501, we get [local count: 97603129]: if (y_5(D) <=3D 9) goto ; [33.00%] else goto ; [67.00%] [local count: 32209032]: _11 =3D z_6(D) + 1; [local count: 97603129]: # prephitmp_17 =3D PHI <2(2), _11(18)> and CCP says _11 is UNDEFINED and merges it with 2 to 2. For me even GCC 9= .3.1 warns, so does GCC 7.5, both even with -O3. We do not warn at -O0 but that's by design - we think doing the predicate b= ased uninit analysis early (on the unoptimized IL) would be too noisy.=