From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5480E3857B8E; Tue, 30 Jan 2024 22:12:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5480E3857B8E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706652752; bh=XyhvbNq0tK8odqSGaY/0DyG2UngDK/Z23QzfvEqru+4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jsze+sjZI0QlPuzg4etPc5jZSuzarhOnzFB8azpJIwVdkhjROpwqwEC7R8EqlXy3c BG2ctkEEQiTBJ8vtXNbe7i7UoeMoXutwj0e9Jnnz6zAz/eZoOe/EskUa4NPdpfC/Wj t/k3FUtIEei+u2yScbvx0oyYrDAFSjOzVp3CUe28= From: "juzhe.zhong at rivai dot ai" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113607] [14] RISC-V rv64gcv vector: Runtime mismatch at -O3 Date: Tue, 30 Jan 2024 22:12:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: juzhe.zhong at rivai dot ai 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: 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=3D113607 --- Comment #20 from JuzheZhong --- (In reply to Robin Dapp from comment #19) > What seems odd to me is that in fre5 we simplify >=20 > _429 =3D .COND_SHL (mask_patt_205.47_276, vect_cst__262, vect_cst__262,= { 0, > ... }); > vect_prephitmp_129.51_282 =3D _429; > vect_iftmp.55_287 =3D VEC_COND_EXPR vect_prephitmp_129.51_282, vect_cst__262>; >=20 > to >=20 > Applying pattern match.pd:9607, gimple-match-10.cc:3817 > gimple_simplified to vect_iftmp.55_287 =3D .COND_SHL (mask_patt_205.47_27= 6, > vect_cst__262, vect_cst__262, { 0, ... }); >=20 > so fold >=20 > vec_cond (mask209, prephitmp129, vect_cst262) > with prephitmp129 =3D cond_shl (mask205, vect_cst262, vect_cst262, 0) >=20 > into > cond_shl =3D (mask205, vect_cst262, vect_cst262, 0)? >=20 > That doesn't look valid to me because the vec_cond's else value > (vect_cst262) gets lost. Wouldn't such a simplification have a condition= al > else value? > Like !mask1 ? else1 : else2 instead of else2 unconditionally? Does ARM SVE have the same issue too ? Since I think we should be using same folding optimization as ARM SVE.=