From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 50E113858282; Thu, 28 Mar 2024 18:26:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 50E113858282 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711650391; bh=d5LgW6Iy58ru2NTV7PNY+BGQEEmauUJ4wl9rc/FDwD0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=phYnTHVE3vlpHzxtid7pvZtIuxe2NHNRzXOrKTPWOBNhPcI1BjYXBqZoIacadeaeM JoQ6QAHYtCwC7d5pkr25M5Nv6D/24eKFe1oOlbnj05Bo3GVA0FaGOueExNDFcRm6Cb 36rS0syaLtMwaZws4crQu4v0OPyTzxfU4lv8KJw4= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114523] bpf: ssa-phiopt optimization generates unverifiable code. Date: Thu, 28 Mar 2024 18:26:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114523 --- Comment #8 from Andrew Pinski --- (In reply to Andrew Pinski from comment #7) > The problem is the verifier: > M=C3=A4r 26 23:57:12 H systemd[1]: 17: (ac) w0 ^=3D w3 = ; > R0_w=3Dscalar() > R3_w=3Dscalar(smin=3Dsmin32=3D0,smax=3Dumax=3Dsmax32=3Dumax32=3D1,var_off= =3D(0x0; 0x1)) > M=C3=A4r 26 23:57:12 H systemd[1]: 18: (57) r0 &=3D 255 = ; > R0_w=3Dscalar(smin=3Dsmin32=3D0,smax=3Dumax=3Dsmax32=3Dumax32=3D255,var_o= ff=3D(0x0; 0xff)) >=20 >=20 > it lost track of what the input of r0 was. It had the right result after = the > xor but then the bit_and didn't take into account the what was before it.= It > just used 0xff. Or rather the verifier is keeping track of rN and rN_w seperately but GCC produces code that uses both and that definitely confuses the verifier. M=C3=A4r 26 23:57:12 H systemd[1]: 16: (77) r3 >>=3D 63 ; R3_w=3Dscalar(smin=3Dsmin32=3D0,smax=3Dumax=3Dsmax32=3Dumax32=3D1,var_off= =3D(0x0; 0x1)) wait why did the verifier use r3_w here rather than just r3? that seems like the issue and would fix this issue easier ...=