https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95433

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marc Glisse <gli...@gcc.gnu.org>:

https://gcc.gnu.org/g:287522613d661b4c5ba8403b051eb470c1674cba

commit r11-2629-g287522613d661b4c5ba8403b051eb470c1674cba
Author: Marc Glisse <marc.gli...@inria.fr>
Date:   Mon Aug 10 12:50:42 2020 +0200

    Simplify X * C1 == C2 with wrapping overflow

    Odd numbers are invertible in Z / 2^n Z, so X * C1 == C2 can be rewritten
    as X == 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  <marc.gli...@inria.fr>

            PR tree-optimization/95433
            * match.pd (X * C1 == 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.

Reply via email to