From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A088D3858D35; Tue, 10 Oct 2023 21:02:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A088D3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696971774; bh=jDZ0z12obPNZh5vIE9H9vMsEJxus9ks+KjnKfuS+MRg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ruGD7nuclVuUajuJNYKAl4wKzKQsQzd3vItjgT6hK1RjaDnDIcEGSsxTYgJ5LT8O/ Y1tf/y4HXl+dqaA74GTROk3zplGnvJaj+mZR1+EMGizyA7RpwmevAz3o/dRwaRiMlE j9Ac0dMfkB6T1Xrxs5Gw5+ffB7xFlw8CsOPe/bMo= From: "rdapp at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111760] risc-v regression: COND_LEN_* incorrect fold/simplify in middle-end Date: Tue, 10 Oct 2023 21:02:53 +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: rdapp at gcc dot gnu.org 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: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111760 Robin Dapp changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rdapp at gcc dot gnu.org, | |rguenth at gcc dot gnu.org --- Comment #2 from Robin Dapp --- https://gcc.gnu.org/pipermail/gcc-patches/2023-September/629904.html prevents the wrong code but still leaves us with a redundant negation (and = it is not the only missed optimization of that kind): vect_neg_xi_14.4_23 =3D -vect_xi_13.3_22; vect_res_2.5_24 =3D .COND_LEN_ADD ({ -1, ... }, vect_res_1.0_17, vect_neg_xi_14.4_23, vect_res_1.0_17, _29, 0); That's because my "hackaround" doesn't recognize a valueized sequence _30 =3D vect_res_1.0_17 - vect_xi_13.3_22; Of course I could (reverse valueize) recognize that again and convert it to= a COND_LEN... but that doesn't seem elegant at all. There must be a simpler = way that I'm missing entirely right now. That said, converting the last statem= ent of such a sequence should be sufficient?=