[Bug tree-optimization/94500] Wrong maximum value with small integer types and AVX-512

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 7 06:28:37 GMT 2020


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

--- 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:bee27152f7e6651f38c25ac68db13370382147e0

commit r10-7581-gbee27152f7e6651f38c25ac68db13370382147e0
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Apr 7 08:27:49 2020 +0200

    i386: Fix emit_reduc_half on V{64Q,32H}Imode [PR94500]

    The following testcase is miscompiled in 8.x, because emit_reduc_half is
    prepared to handle for 512-bit modes only i equal to 512, 256, 128 and 64.
    V32HImode also needs i equal to 32 and V64QImode i equal to 32 and 16,
    but emit_reduc_half in that case performs a redundant permutation exactly
    like i == 32.  In 9+ the testcase works because Richard in r9-3393
    changed the reduc_* expanders so that they actually don't call
    ix86_expand_reduc on 512-bit modes, but only 128-bit ones.

    The patch fixes emit_reduc_half to handle also i of 32 and 16 similarly to
    how V32QImode/V16HImode are handled for AVX2.  I think it shouldn't hurt
    to fix the function even on the trunk and 9 branch even when nothing uses
    it ATM.

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

            PR target/94500
            * config/i386/i386-expand.c (emit_reduc_half): For V{64QI,32HI}mode
            handle i < 64 using avx512bw_lshrv4ti3.  Formatting fixes.

            * gcc.target/i386/avx512bw-pr94500.c: New test.


More information about the Gcc-bugs mailing list