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

--- Comment #6 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:b0d624726cccdb855f9e1ba68edbd5c30913457b

commit r15-4249-gb0d624726cccdb855f9e1ba68edbd5c30913457b
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Fri Oct 11 11:41:53 2024 +0200

    i386: Fix up spaceship expanders for -mtune=i[45]86 [PR117053]

    The adjusted and new spaceship expanders ICE with -mtune=i486 or
    -mtune=i586.
    The problem is that in that case TARGET_ZERO_EXTEND_WITH_AND is true
    and zero_extendqisi2 isn't allowed in that case, and we can't use
    the replacement AND, because that clobbers flags and we want to use them
    again.

    The following patch fixes that by using in those cases roughly what
    we want to expand it to after peephole2 optimizations, i.e. xor
    before the comparison, *setcc_qi_slp and sbbl $0 (or for signed
    int case xoring of 2 regs, two *setcc_qi_slp, subl).
    For *setcc_qi_slp, it uses the setcc_si_slp hacks with UNSPEC that
    were in use for the floating point jp case (so such code is IMHO
    undesirable for the !TARGET_ZERO_EXTEND_WITH_AND case as we want to
    give combiner more liberty in that case).

    2024-10-11  Jakub Jelinek  <ja...@redhat.com>

            PR target/117053
            * config/i386/i386-expand.cc (ix86_expand_fp_spaceship): Handle
            TARGET_ZERO_EXTEND_WITH_AND differently.
            (ix86_expand_int_spaceship): Likewise.

            * g++.target/i386/pr116896-3.C: New test.

Reply via email to