From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6E4D13858D3C; Sun, 28 May 2023 00:18:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E4D13858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685233118; bh=OYTZtwwniqe2pCihaNiuDX0wdEEdVIxwUNMIiXqJ55w=; h=From:To:Subject:Date:From; b=GtqBJkuHXjwrsQ4uZxqnjmxvEdBz8EQu3A7m5RZz5UELQQ1tQkHtVlrMAALRBSovL 1tSVwQzuI/XueCJa9b9YuOY7ZdpOwSgcFIJq+JZ4Sj6aCHmW/m0cdoxgwLaRj1P6fZ B/q45mr1trZ8+O9fIrHPXAhflCQndHMZY9nzhgac= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110009] New: Another missing ABS detection Date: Sun, 28 May 2023 00:18:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter blocked target_milestone Message-ID: 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=3D110009 Bug ID: 110009 Summary: Another missing ABS detection Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Blocks: 109907 Target Milestone: --- Take: ``` unsigned f1 (int v) { unsigned int d_6; int b_5; unsigned int v1_2; unsigned int _7; int _9; b_5 =3D v>>(sizeof(v)*8 - 1); _9 =3D b_5 | 1; d_6 =3D (unsigned int) _9; v1_2 =3D (unsigned int) v; _7 =3D v1_2 * d_6; return _7; } ``` This currently does not get converted to `return ABSU`. I found this while implementing a different match pattern and found that the testcase pr103245-1.c was failing. This blocks PR 109907 because the patch which is to fix a regression from t= he patch of bug 109907 comment #25 introduces this. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109907 [Bug 109907] Missed optimization for bit extraction (uses shift instead of single bit-test)=