From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EC8EF3858429; Thu, 30 Nov 2023 21:57:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC8EF3858429 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701381428; bh=NuEOAlz9WHA8JcSWX0It9eAHZGVqZZkawxtGtOMGfgg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fepe2MMgD0tMwZ/3kVs//2c2lsc2IBMlK9bw6ResiknhXZfdjQOQubGsbOuhen6Ee e0CWVEXmDoLKrBagPDBMYO8uHHdCFuAM/DnGgSBq35HXZ6Fa5R1PD2m4sLOzsCR4VZ sEdfRtoZQEsdPxV9ej1bzbSkpdDcNvfAEDAnJJHo= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/112740] [14 Regression] wrong code with vector compare on riscv64 at -O0 Date: Thu, 30 Nov 2023 21:57:08 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: component 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=3D112740 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Component|target |middle-end --- Comment #7 from Andrew Pinski --- Oh it is not the ~ but rather `_3 =3D {_16};` which produces the wrong code: // _16; // vector(1) _3; ;; _3 =3D {_16}; (insn 36 35 37 (set (reg:TI 114) (reg:TI 102 [ _16 ])) "/app/example.cpp":15:6 -1 (nil)) (insn 37 36 38 (set (subreg:DI (reg:TI 113) 0) (and:DI (subreg:DI (reg:TI 114) 0) (const_int 1 [0x1]))) "/app/example.cpp":15:6 -1 (nil)) (insn 38 37 39 (set (reg:DI 115) (const_int 0 [0])) "/app/example.cpp":15:6 -1 (nil)) (insn 39 38 40 (set (subreg:DI (reg:TI 113) 8) (and:DI (subreg:DI (reg:TI 114) 8) (reg:DI 115))) "/app/example.cpp":15:6 -1 (nil)) (insn 40 39 0 (set (reg:TI 94 [ _3 ]) (reg:TI 113)) "/app/example.cpp":15:6 -1 (nil)) That is wrong. that is producing 1 in _3 when it should have been -1 . That is it is doing `r94 =3D r102 & 0x1` which is totally wrong/broken ...=