From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E8B7C3858C20; Thu, 1 Dec 2022 17:32:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E8B7C3858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669915979; bh=F3rvWpVWZJpX7eUhpjuEDkJn9P+mI6Ra6QCJDIfEde8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BV1BQ4Ut9233DCFrHynAAlIEGlcIocgoASKxYHKFn7bCFhgAKFR7vIAtcR1KpYudj 9r2HM5b89SqlE5tTDF+4AC0nW/ixxVdtgRnPoQGm3SZoFmf6RRpLHlpt/zfss4MdiP x0xdp7kT4dpHAj8vWyL8paRYmICLIRaFlnDr8CyE= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107833] [12/13 Regression] wrong code at -Os and above on x86_64-linux-gnu since r12-5138-ge82c382971664d6f Date: Thu, 01 Dec 2022 17:32:59 +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: 12.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 12.3 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=3D107833 --- Comment #9 from Jakub Jelinek --- Wasn't this discussed in the past in other PRs? Whether uninitialized vars mean anything or anything but same value each time a SSA_NAME initialized t= o it is used? Because as this testcase shows, not all uses of uninitialized SSA_NAMEs are actually UB, at least their use in PHIs must be ok, and if IVOPTS or other optimizations can construct some expressions computing a difference between uninitialized loop iterator's PHI header between several iterations (e.g. to compute final value), it better would be the second definition rather than = the first.=