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

--- Comment #3 from CVS 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:f626ae5478887b0cec886160dcfc4d59bf6fda07

commit r10-6400-gf626ae5478887b0cec886160dcfc4d59bf6fda07
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Mon Feb 3 09:00:19 2020 +0100

    s390x: Fix popcounthi2_z196 expander [PR93533]

    The following testcase started to ICE when .POPCOUNT matching has been
added
    to match.pd; we had __builtin_popcount*, but nothing would use the
    popcounthi2 expander before.

    The problem is that the popcounthi2_z196 expander doesn't emit valid RTL:
    error: unrecognizable insn:
    (insn 138 137 139 27 (set (reg:SI 190)
            (ashift:SI (reg:HI 95 [ _105 ])
                (const_int 8 [0x8]))) -1
         (nil))
    during RTL pass: vregs
    The following patch is an attempt to fix that, furthermore I've tried to
    slightly simplify it as well, it makes no sense to me to perform
    (x + (x << 8)) >> 8 when we need to either zero extend or mask the result
    at the end in order to avoid bits from above HImode to affect it, when we
    can do
    (x + (x >> 8)) & 0xff (or zero extension).

    2020-02-03  Jakub Jelinek  <ja...@redhat.com>

        PR target/93533
        * config/s390/s390.md (popcounthi2_z196): Fix up expander to emit
        valid RTL to sum up the lowest and second lowest bytes of the popcnt
        result.

        * gcc.c-torture/compile/pr93533.c: New test.
        * gcc.target/s390/pr93533.c: New test.

Reply via email to