From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6E2EE3858409; Tue, 4 Jul 2023 06:33:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E2EE3858409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688452384; bh=6vwgPBd8VxPxuYSjFEtpnwGdV+EslP006z4oV9m+3G8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=e/eVhFJiVemABKBY5DdlsCNQI8xNkx/vydhPf1jqN5JweOfBC65z7oCPfIjelhr6q DIXP+fA8k7n+wxKoCdWiq2l95CtqrMXwqEtoW7k26cBhi5xAvCEVvsaUs19jUCKwx4 hRJDyBAEL62BcfdDiJ/Pj7Eovt7BOHKT4nPd0cco= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110228] [13/14 Regression] llvm-16 miscompiled due to an maybe uninitialized variable Date: Tue, 04 Jul 2023 06:33:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code 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: 13.2 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=3D110228 --- Comment #26 from Richard Biener --- (In reply to Sergei Trofimovich from comment #24) > Trying to understand the failure mode here: >=20 > In bug.c.033t.early_objsz I still see the explicit stores to LocalFlags: >=20 > : > LookupFlags_15 =3D 0; > goto ; [INV] >=20 > : > if (v_13 =3D=3D 1) > goto ; [INV] > else > goto ; [INV] >=20 > : > LookupFlags_14 =3D 1; >=20 > : > # LookupFlags_4 =3D PHI LookupFlags_14(6)> > *p_16(D) =3D LookupFlags_4; >=20 > But in bug.c.034t.ccp1 I see no stores at all: >=20 > if (v_13 =3D=3D 0) > goto ; [INV] > else > goto ; [INV] >=20 > : > if (v_13 =3D=3D 1) > goto ; [INV] > else > goto ; [INV] >=20 > : >=20 > : > # LookupFlags_4 =3D PHI <0(3), LookupFlags_5(4), 1(5)> >=20 > Specifically '# LookupFlags_4 =3D PHI <0(3), LookupFlags_5(4), 1(5)>' cla= ims > that somehow gets values '0' and '1' into a PHI node. >=20 > AFAIU PHI is an equivalent of a mutable variable in an otherwise immutable > SSA form. It has to be a write it needed value is not there yet. Why the > store of '1' was removed? Is it because variable 'v_13' already happens to > have 0 or 1 value? >=20 > I wonder why PHI does not look like something below: >=20 > # LookupFlags_4 =3D PHI LookupFlags is in SSA form thus we are dealing with registers and no "store= s". What happens is just constant propagation, LookupFlags_1{4,5} can be replaced with their assigned constant.=