From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 14D8B384AB73; Wed, 17 Apr 2024 17:34:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14D8B384AB73 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713375243; bh=8VZkR1bhAAt99J3Un56/oCZMm7UgQwlNhITsj1bIOw0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Irxp/9P1rMilk/mwt60/WF2Ik+RfUvKKpQNzQu0w3Rh3T3cvoL4sCTDoMpNkkySxC hwgX5mbDwvmEjGMslZgq46Gd41dVCalvMTJhblCZkMYbIJIzNbqY9I/i1X8s/T44gE Zf53jwiNnUAtdbtj+wbE6hHRWluXDyh1QIH+VAjs= From: "jakub 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:34:01 +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: jakub 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 #14 from Jakub Jelinek --- (In reply to Andreas Krebbel from comment #13) > 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. It is pretty clear that the element type pointer needs to alias > vectors of the same element type, but there is no saying about aliasing > everything. >=20 > I'm just wondering how to improve the diagnostics in our backend to catch > this. 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. We need a TBAA analyzer among sanitizers (but writing it is really hard). > #include >=20 > void __attribute__((noinline)) foo (int *mem) > { > vec_xst ((vector float){ 1.0f, 2.0f, 3.0f, 4.0f }, 0, (float*)mem); So use *(vector float __attribute__((__may_alias__)) *)mem =3D (vector float){ 1= .0f, 2.0f, 3.0f, 4.0f }; instead? Sure, GCC extension, not an intrinsic in that case...=