From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6150A3858289; Thu, 10 Nov 2022 14:56:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6150A3858289 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668092203; bh=K3+07VNYbI678BxPBw8hsr7sj74as3YAchK0gcuTS3A=; h=From:To:Subject:Date:From; b=mVBGyh9gkZvZWhr01ntYP/gAipHm23lWhloM5hTcBf+n65U4GK2+b/tQ6L4Oz/EnF Y2QvKbbC6l0QCQcvg1u+gXoKPp26wdHoOILfYRUbPPO+qmfxo+afBemmqt/kQlrkG2 TuYVxmRT/nDSvavVTCdm4BQjlQhMV6RPqF1BIFI4= From: "rdapp at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/107617] New: SCC-VN with len_store and big endian Date: Thu, 10 Nov 2022 14:56:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rdapp 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone cf_gcctarget attachments.created Message-ID: 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=3D107617 Bug ID: 107617 Summary: SCC-VN with len_store and big endian Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: rdapp at gcc dot gnu.org CC: richard.guenther at gmail dot com Target Milestone: --- Target: s Created attachment 53871 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53871&action=3Dedit s390 patch for len_load/len_store Hi, Richard and I already quickly discussed this on the mailing list but I didn= 't manage to progress analyzing as I was tied up with other things. Figured I open a bug for tracking purposes and the possibility to maybe fix it in a l= ater stage. I'm evaluating len_load/len_store support on s390 via the attached patch and seeing a FAIL in testsuite/gfortran.dg/power_3.f90 built with -march=3Dz16 -O3 --param vect-partial-vector-usage=3D1 The problem seems to be that we evaluate a vector constant {-1, 1, -1, 1} loaded with length 11 + 1(bias) =3D 12 as {1, -1, 1} instead of {-1, 1, -1}. Richard wrote on the mailing list: > The error is probably in vn_reference_lookup_3 which assumes that > 'len' applies to the vector elements in element order. See the part > of the code where it checks for internal_store_fn_p. If 'len' is with > respect to the memory and thus endianess has to be taken into > account then for the IFN_LEN_STORE >=20 > else if (fn =3D=3D IFN_LEN_STORE) > { > pd.rhs_off =3D 0; > pd.offset =3D offset2i; > pd.size =3D (tree_to_uhwi (len) > + -tree_to_shwi (bias)) * BITS_PER_UNIT; > if (ranges_known_overlap_p (offset, maxsize, > pd.offset, pd.size)) > return data->push_partial_def (pd, set, set, > offseti, maxsizei); >=20 > likely needs to adjust rhs_off from zero for big endian?=