From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C2C2B3898382; Mon, 5 Dec 2022 09:32:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C2C2B3898382 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670232766; bh=cHpPO/cDbyRRAf4HDK0uW6PBNUsAmiHhuotghIWykUQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wrXde1k91w8HmAuXXmvQhm0LSotH1qIIiU6sBVeJsdUiC9JV5p3A5PV3jFLzc7cez EoWr+LNOtqmLX84cTWL3aQri3iWULK2uP++oaKLZ9qk1VEq4Di3YS9UaFsXImUgAKg yJz3oBksmyCYoMOOGIS48JMoDIjsfJBRS2EePCiU= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107839] spurious "may be used uninitialized" warning while all uses are under "if (c)" Date: Mon, 05 Dec 2022 09:32:45 +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: 13.0 X-Bugzilla-Keywords: diagnostic 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: rguenth 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=3D107839 --- Comment #4 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:44c8402d35160515b3c09fd2bc239587e0c32a2b commit r13-4491-g44c8402d35160515b3c09fd2bc239587e0c32a2b Author: Richard Biener Date: Fri Dec 2 14:52:20 2022 +0100 tree-optimization/107833 - invariant motion of uninit uses The following fixes a wrong-code bug caused by loop invariant motion hoisting an expression using an uninitialized value outside of its controlling condition causing IVOPTs to use that to rewrite a defined value. PR107839 is a similar case involving a bogus uninit diagnostic. PR tree-optimization/107833 PR tree-optimization/107839 * cfghooks.cc: Include tree.h. * tree-ssa-loop-im.cc (movement_possibility): Wrap and make stmts using any ssa_name_maybe_undef_p operand to preserve execution. (loop_invariant_motion_in_fun): Call mark_ssa_maybe_undefs to init maybe-undefined status. * tree-ssa-loop-ivopts.cc (ssa_name_maybe_undef_p, ssa_name_set_maybe_undef, ssa_name_any_use_dominates_bb_p, mark_ssa_maybe_undefs): Move ... * tree-ssa.cc: ... here. * tree-ssa.h (ssa_name_any_use_dominates_bb_p, mark_ssa_maybe_undefs): Declare. (ssa_name_maybe_undef_p, ssa_name_set_maybe_undef): Define. * gcc.dg/torture/pr107833.c: New testcase. * gcc.dg/uninit-pr107839.c: Likewise.=