From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 063A73857835; Thu, 10 Dec 2020 10:33:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 063A73857835 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/98221] [11 regression] Wrong unpack operation emitted in tree-ssa-forwprop.c Date: Thu, 10 Dec 2020 10:33:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: major X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2020 10:33:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98221 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rsandifo at gcc dot gnu.org --- Comment #1 from Richard Biener --- But all GIMPLE operates on "GIMPLE lane order" so this is a defect in how t= he backend handles those tree codes at expansion time? You'll find no mention of BYTES_BIG_ENDIAN in the vectorizer (ok, you find exactly one - but other UNPACK_LO/HI uses in other places). >>From looking at tree-vect-generic.c VEC_UNPACK_{,FIX_TRUNC,FLOAT}_{LO,HI}_E= XPR are subject to this while supportable_widening_operation adds some more LO,HI but also one EVEN,ODD case. (Ab-)using BYTES_BIG_ENDIAN is also a bit odd, if we insist on preserving this endian dependency on GIMPLE it should be a VECTOR_LANES_BIG_ENDIAN or so. But it doesn't seem to be consistently implemented. The patch looks "obvious" if the semantics are dependent on BYTES_BIG_ENDIAN but I see that nowhere documented and it's contrary to my expectation of GIMPLE semantics (GIMPLE semantics assumes memory order).=