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

--- Comment #6 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #4)
> 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.

It is some target code that decided what to do with the CCGC thing.  It decided
to use CCZ instead, which of course is wrong if other conditions are used (and
should ICE if you try to use it for non-equality actually).

Reply via email to