https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80501
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, combine_simplify_rtx turns:
(set (reg:CCNO 17 flags)
(compare:CCNO (subreg:QI (and:SI (lshiftrt:SI (reg:SI 97)
(const_int 24 [0x18]))
(const_int 128 [0x80])) 0)
(const_int 0 [0])))
into:
(set (reg:CCNO 17 flags)
(compare:CCNO (subreg:QI (lshiftrt:SI (reg:SI 97)
(const_int 31 [0x1f])) 0)
(const_int 0 [0])))
which is a wrong transformation, because it is equivalent only if the flags
consumer only tests for equality/non-equality and nothing else. Equivalent
comparison would be I think:
(set (reg:CCNO 17 flags)
(compare:CCNO (reg:SI 97) (const_int 0 [0])))
if the flags user tests against 0 (e.g. gt, lt, etc.).