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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |segher at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Indeed, combine_simplify_rtx on
(set (reg:CCGC 17 flags)
    (compare:CCGC (sign_extract:SI (reg/v:SI 101 [ g ])
            (const_int 1 [0x1])
            (const_int 0 [0]))
        (const_int -1 [0xffffffffffffffff])))
with VOIDmode, false, false remaining arguments is optimizing it to
(set (reg:CCZ 17 flags)
    (compare:CCZ (zero_extract:SI (reg/v:SI 101 [ g ])
            (const_int 1 [0x1])
            (const_int 0 [0]))
        (const_int 0 [0])))
which is ok if it would be used solely in equality/non-equality comparisons,
but is not ok when it is used in other comparisons. 1-bit sign_extract has
range [-1,0] and
[-1,0] < -1 is always false.

Reply via email to