From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3A7EB3858D20; Wed, 17 Apr 2024 17:01:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A7EB3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713373289; bh=xb54YFjZpe2pK17AueV1jne5HnPB0T1dmNs9JOiMfSo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=S0c9AbIx4IBF6G5KIpL+bYnDA0eILcw27Bmpo0UR/s9EPrNEVrPWhNeZTsqbRDUBy +RilTnlsksa3odfwbm08PmHOyLQ4wb7jhPJuCiXWjsIDKBPNqvuQBWWpErmGIJ9cwd MhLwikMkZwLwBTUNRyBkpPXX8EEDAfeRGMQmynwI= From: "krebbel at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114676] [12/13/14 Regression] DSE removes assignment that is used later Date: Wed, 17 Apr 2024 17:01:26 +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: 12.1.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: krebbel at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.4 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=3D114676 --- Comment #13 from Andreas Krebbel --- We will go and fix PyTorch instead. Although it is not clearly documented, = the way PyTorch uses the builtin right now is probably not what was intended. I= t is pretty clear that the element type pointer needs to alias vectors of the sa= me element type, but there is no saying about aliasing everything. I'm just wondering how to improve the diagnostics in our backend to catch t= his. The example below is similar to what PyTorch does today. Casting mem to (float*) prevents our builtin code from complaining about the type mismatch= and by that opens the door for the much harder to debug TBAA problem. #include void __attribute__((noinline)) foo (int *mem) { vec_xst ((vector float){ 1.0f, 2.0f, 3.0f, 4.0f }, 0, (float*)mem); } int main () { int m[4] =3D { 0 }; foo (m); if (m[3] =3D=3D 0) __builtin_abort (); return 0; }=