From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0831E384640E; Thu, 25 Apr 2024 00:14:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0831E384640E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714004059; bh=DEn9vw4GVt4qQIa9a22y0MqXpgCcStyAs5iNpmp9bRc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mI1nUnCS+PrmNA9Ak2OrfWVr616ehROfUhmJV040/o+UFV8sRNUCuqTU89NKaIIuI JYaFhvoUThn6cE8sXoAk4zd1M8IRmY7cK7kkCvqdAUCbiYRY0v8GzEdq2VvnEbZf0W KtWoCrHLOkgAOGaB6U95/WgAKgkSpfL2K/+qU8Zo= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/112304] cinc is not being used for (small) constant Date: Thu, 25 Apr 2024 00:14:18 +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: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia 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=3D112304 --- Comment #4 from Andrew Pinski --- Note my patch does not change the fact that we don't pull the mov outside of the loop for: ``` void f(int *a, int l) { for(int i =3D 0; i < l; i++) a[i]=3D(a[i]!=3D0)+42; } ``` But that is for a different issue to fix. The issue there is we have a cset= /add during the (RTL) LIM and we don't pull the constant out from the add. And t= hen we go and do the combine and found it is an cinc and then 42 becomes part of the cinc. This is pre-existing issue and most likely could be reproduce with other testcases too.=