From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A18483858CDB; Sat, 11 Feb 2023 16:38:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A18483858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676133512; bh=B7Ad1WRWTwPOA32/86ffFqwtTflQtvt9x9VOjggVyW8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GJfK+DGlhTKWhqsgMaMUE66noWC3zHIL2wHT8BP5vMfjHMwAD2D6vT2qyD345c1JC bDtmDIwYIfgOr+qFnljVRByYvpplBiPinqbWH82YW6VT4XYHTZfeOwqPgeCbXmLdkV EKWLashv6ibSg8o+CEmpg8+0tHHmDSJEycVnfzuc= From: "segher at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108757] We do not simplify (a - (N*M)) / N + M -> a / N Date: Sat, 11 Feb 2023 16:38:32 +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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: segher 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: cc 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=3D108757 Segher Boessenkool changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |segher at gcc dot gnu.org --- Comment #4 from Segher Boessenkool --- If N is a power of two optimising this to a/N is valid, but for other values of N it is not (division is not the inverse of multiplication in C). It al= so only works for unsigned of course.=