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

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

https://gcc.gnu.org/g:03877e7eccd2734ca93a2d13aa2abf55e0aec923

commit r14-5900-g03877e7eccd2734ca93a2d13aa2abf55e0aec923
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Tue Nov 28 10:14:55 2023 +0100

    match.pd: Fix popcount (X) + popcount (Y) simplification [PR112719]

    Since my PR112566 r14-5557 changes the following testcase ICEs, because
    .POPCOUNT (x) + .POPCOUNT (y) has a simplification attempted even when
    x and y have incompatible types (different precisions).
    Note, with _BitInt it can ICE already starting with r14-5435 and
    I think as a latent problem it exists for years, because IFN_POPCOUNT
    calls inherently can have different argument types and return type
    is always the same.
    The following patch fixes it by using widest_int during the analysis
    (which is where it was ICEing) and if it is optimizable, casting to
    the wider type so that bit_ior has matching argument types.

    2023-11-28  Jakub Jelinek  <ja...@redhat.com>

            PR tree-optimization/112719
            * match.pd (popcount (X) + popcount (Y) -> POPCOUNT (X | Y)): Deal
            with argument types with different precisions.

Reply via email to