From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 50F9E3858CD1; Thu, 11 Apr 2024 12:35:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 50F9E3858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712838955; bh=El4NDXqECbyU9+yEkWcLPDOag8OmHPNhzSt9nKFhMO8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gsbf3sqHFMYf0w21BdR0i+QLzHGxVVh0ibDUQp6sAvj7A1wol241WItE15YFcwmJr 4XE2WvAPCXIy+M+16zd/eHasPPHyYZsk81rLSySNQX2SFNfLIQz10ohvKIFbfU5wMF a062OLYuW+FZ+8mfxs8BZatWaK1BOWWiuTflllFw= 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: Thu, 11 Apr 2024 12:35:54 +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: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 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 #9 from Jakub Jelinek --- It depends on what the vec_xl*/vec_xst* documentation requires/user expect. If the expectation is that the loads/stores should alias the scalar pointee= of the pointer type passed to those intrinsics, then --- gcc/config/s390/s390-c.cc.jj 2024-01-03 11:51:54.847407588 +0100 +++ gcc/config/s390/s390-c.cc 2024-04-10 16:30:31.896197832 +0200 @@ -498,8 +498,8 @@ s390_expand_overloaded_builtin (location /* Build a vector type with the alignment of the source location in order to enable correct alignment hints to be generated for vl. */ - tree mem_type =3D build_aligned_type (return_type, - TYPE_ALIGN (TREE_TYPE (TREE_TYPE ((*arglist)[1])))); + unsigned align =3D TYPE_ALIGN (TREE_TYPE (TREE_TYPE ((*arglist)[1])= )); + tree mem_type =3D build_aligned_type (return_type, align); return build2 (MEM_REF, mem_type, fold_build_pointer_plus ((*arglist)[1], (*arglist)[0= ]), build_int_cst (TREE_TYPE ((*arglist)[1]), 0)); @@ -511,11 +511,13 @@ s390_expand_overloaded_builtin (location /* Build a vector type with the alignment of the target location in order to enable correct alignment hints to be generated for vst. */ - tree mem_type =3D build_aligned_type (TREE_TYPE((*arglist)[0]), - TYPE_ALIGN (TREE_TYPE (TREE_TYPE ((*arglist)[2])))); + unsigned align =3D TYPE_ALIGN (TREE_TYPE (TREE_TYPE ((*arglist)[2])= )); + tree mem_type =3D build_aligned_type (TREE_TYPE ((*arglist)[0]), al= ign); return build2 (MODIFY_EXPR, mem_type, - build1 (INDIRECT_REF, mem_type, - fold_build_pointer_plus ((*arglist)[2], (*arglist)[1])), + build2 (MEM_REF, mem_type, + fold_build_pointer_plus ((*arglist)[2], + (*arglist)[1]), + build_int_cst (TREE_TYPE ((*arglist)[2]), 0)= ), (*arglist)[0]); } case S390_OVERLOADED_BUILTIN_s390_vec_load_pair: might be all that is needed (if it is needed at all). If the expectation is that one can read what has been written by those intrinsics or write what will be read by those intrinsics though unrelated effective pointers, = then it should alias everything, which could be say just using ptr_type_node instead of the current types in both of the build_int_cst (..., 0) calls above.=