From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3C668385702C; Mon, 10 Aug 2020 10:53:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C668385702C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597056818; bh=6HNoIcndoUv3AjVGdABl64MRsubWt435XnDYz+waQo0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QwRFq5ucLdPsDr5osyJktY6YEGXpKLlHaZ1OtLLmMYeOPkZc2gpUzoDXglwm+kYT6 2eg5s2B3XzK4RZ6v2B21EPHaBcDbj15bqDAkTW3lUcXfwC8ZrOBKMwdZOkva8XpIkZ xSfqVmMexF9Qo37Qc3aTmOMrAUIqrGd1DMI5fSEA= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/95433] Failure to completely optimize simple compare after operations Date: Mon, 10 Aug 2020 10:53:37 +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: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2020 10:53:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95433 --- Comment #7 from CVS Commits --- The master branch has been updated by Marc Glisse : https://gcc.gnu.org/g:287522613d661b4c5ba8403b051eb470c1674cba commit r11-2629-g287522613d661b4c5ba8403b051eb470c1674cba Author: Marc Glisse Date: Mon Aug 10 12:50:42 2020 +0200 Simplify X * C1 =3D=3D C2 with wrapping overflow Odd numbers are invertible in Z / 2^n Z, so X * C1 =3D=3D C2 can be rew= ritten as X =3D=3D C2 * inv(C1) when overflow wraps. mod_inv should probably be updated to better match the other wide_int functions, but that's a separate issue. 2020-08-10 Marc Glisse PR tree-optimization/95433 * match.pd (X * C1 =3D=3D C2): Handle wrapping overflow. * expr.c (maybe_optimize_mod_cmp): Qualify call to mod_inv. (mod_inv): Move... * wide-int.cc (mod_inv): ... here. * wide-int.h (mod_inv): Declare it. * gcc.dg/tree-ssa/pr95433-2.c: New file.=