From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3F7F03858C27; Thu, 6 Jul 2023 10:21:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F7F03858C27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688638880; bh=vo7rcsExQMTjfZP3Redv0uIcfzbp3CohxeW2XTWTe6Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KDF7i6FCCEsorGWUfseqY1NreEDJSNEkB80bFrjZ+4PhWxccJkgvh0NZ7KNMmpL4G GJuVugdwdmlXqKFFAx2yvgTxm5/9OmHUvyfpBpcjth3C34Jyln5F42VNaUMlqH9ZT0 kkvcpVNvEPTcgx0a8DgtoOOw0JiKKVNibR00bfk0= From: "xry111 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110557] [13/14 Regression] Wrong code for x86_64-linux-gnu with -O3 -mavx2: vectorized loop mishandles signed bit-fields Date: Thu, 06 Jul 2023 10:21:19 +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: xry111 at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: avieira at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.3 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=3D110557 --- Comment #3 from Xi Ruoyao --- It looks like if !UNSIGNED_TYPE (TREE_TYPE (bf_ref)), we need to generate something like: masked =3D (the signed variant of the wider type in {type_out, type_contain= er}) container << (bitpos + bitsize); result =3D (type_out) >> bitpos;=