From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 972DF3858D35; Thu, 9 Nov 2023 17:57:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 972DF3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699552648; bh=Hi5rl3cIr/M09ylX+eMgBY3kZxa69c4srK7o4xlQ1ig=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EROdIyG+0FEa3N5jffCL1vjRGlNsT86l4WDkTiDhWPLF86HkJs/l9bQzhaws3DARd Ej7H+eDhsvA6N3XAWBze/j32kmLJF96XgMNK64GvFQ2IFxs5CbBEzvUNWr5Xbh4G2I La22Rxwm11XLxcvJIcC6tEK/xMMv9pXXj0rvhCFY= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/112454] csinc (csel is though) is not being used when there is matches twice Date: Thu, 09 Nov 2023 17:57:28 +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: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia 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: 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=3D112454 --- Comment #1 from Andrew Pinski --- here is another testcase which shows the issue with pulling the constant one out of the loop when it could have been merged with the csel to use csinc: ``` int f(int *a, int n, int *b, int d) { for(int i =3D 0; i < n; i++) b[i] =3D a[i] =3D=3D 100 ? 1 : d; return 0; } ```=