From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BF9533858D1E; Thu, 3 Aug 2023 13:01:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF9533858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691067676; bh=WC2stBMo4/YV2k0WGoDpWd+hE57YubLrDC6FVejIsGI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xRh/bwQYuvqZ9lHV8mDEjDoH28f9zCB3vWfVp+04f6GD7wzdGIImfBGsVp1SxLCPB euXC+774kREN4nceLQgNtgfR+jdhK7g0k9jPJEeaXGx+azHK0m+JKpn9O4RUmh0wWE cBBjQcKavbEKmcC9qKe9DTohuGyJrBWe9o8PUuCg= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110838] [14 Regression] wrong code on x365-3.5, -O3, sign extraction Date: Thu, 03 Aug 2023 13:01:15 +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: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_known_to_work 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=3D110838 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Known to work| |14.0 --- Comment #9 from Richard Biener --- Fixed on trunk. I think the issue is present on the branches as well in th= at we generate vect_patt_48.21_145 =3D VIEW_CONVERT_EXPR(vect_patt_49.20_143); vect_patt_48.21_146 =3D VIEW_CONVERT_EXPR(vect_patt_49.20_144); vect_patt_46.22_147 =3D vect_patt_48.21_145 >> 31; vect_patt_46.22_148 =3D vect_patt_48.21_146 >> 31; and psraw $31, %xmm3 psraw $31, %xmm2 so we have out-of-bound arithmetic vector shifts here which might or might not cause issues on other targets than x86. psraw documents "If the value specified by the count operand is greater than 15 (for words) [...], each destination data element is fille with the initial value of the sign bit of the element." which is what we intended to compute.=