[Bug tree-optimization/94718] Failure to optimize opposite signs check

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon May 4 08:59:14 GMT 2020


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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:73a8043481d24ac86ce8d19459276181dfd9c858

commit r11-34-g73a8043481d24ac86ce8d19459276181dfd9c858
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon May 4 10:57:46 2020 +0200

    match.pd: Move (X & C) eqne (Y & C) -> -> (X ^ Y) & C eqne 0 opt to
match.pd [PR94718]

    This patch moves this optimization from fold-const.c to match.pd where it
    is actually much shorter to do and lets optimize even code not seen
together
    in a single expression in the source, as the first step towards fixing the
    PR.

    2020-05-04  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/94718
            * fold-const.c (fold_binary_loc): Move (X & C) eqne (Y & C)
            -> (X ^ Y) & C eqne 0 optimization to ...
            * match.pd ((X & C) op (Y & C) into (X ^ Y) & C op 0): ... here.

            * gcc.dg/tree-ssa/pr94718-1.c: New test.
            * gcc.dg/tree-ssa/pr94718-2.c: New test.


More information about the Gcc-bugs mailing list