From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5B6163858D38; Wed, 12 Jul 2023 07:25:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B6163858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689146756; bh=rQhKwWwsM4nT8R8D13VOqJ3hEfJXtRlWM2tXCXhPWro=; h=From:To:Subject:Date:From; b=v2xJnczjdAOiCv5NqXMyXkEUdznSZPza3qcmPr6LD8jmSs8/zjXNpd5H41c39FWbG WG3LGc1c92QImpytFX1JLjESdNGe6e41KFD/oBanRyimIkwwzcf/S1QmXoY3Pi1Ar9 dkvlxPbHYaIGbtjbl0CTELrp4daKwQYObYsdPKDQ= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110637] New: (type)(zeroonep !=/== 0) should be optimized as (type)zeroonep/zeroonep^1 earlier than vrp Date: Wed, 12 Jul 2023 07:25:56 +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: 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter 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=3D110637 Bug ID: 110637 Summary: (type)(zeroonep !=3D/=3D=3D 0) should be optimized as (type)zeroonep/zeroonep^1 earlier than vrp Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Take: ``` int f(int t) { t &=3D 1; return t !=3D 0; } ``` Currently this only gets optimized at -O2 (due to VRP) to: _4 =3D t_1(D) & 1; return _4; Likewise for: ``` int g(int t) { t &=3D 1; return t =3D=3D 0; } ``` This was originally how I was going to solve PR 110539 but when we should optimize to those gets in the way of other optimizations so I decided to fi= x PR 110539 a different way.=