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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Ah, and nonzero_bits ((reg:SI 93), SImode) == 1.  So (plus:SI (ltu:SI (reg:SI
93) (const_int -1)) (const_int -1)) is also (const_int 0).

reg:SI 93 is even constant 1.  So in:
(insn 19 18 20 4 (set (reg:CC 17 flags)
        (compare:CC (reg:SI 93)
            (subreg:SI (reg/v:DI 89 [ d ]) 0))) "pr82628.c":20 7 {*cmpsi_1}
     (expr_list:REG_DEAD (reg:SI 93)
        (expr_list:REG_EQUAL (compare:CC (const_int 1 [0x1])
                (subreg:SI (reg/v:DI 89 [ d ]) 0))
            (nil))))
(insn 20 19 21 4 (parallel [
            (set (reg:CCGZ 17 flags)
                (compare:CCGZ (reg:SI 94)
                    (plus:SI (ltu:SI (reg:CC 17 flags)
                            (const_int 0 [0]))
                        (subreg:SI (reg/v:DI 89 [ d ]) 4))))
            (clobber (scratch:SI))
        ]) "pr82628.c":20 307 {subsi3_carry_ccgz}
     (expr_list:REG_DEAD (reg:SI 94)
        (expr_list:REG_EQUAL (compare:CCGZ (const_int 0 [0])
                (plus:SI (ltu:SI (reg:CC 17 flags)
                        (const_int 0 [0]))
                    (subreg:SI (reg/v:DI 89 [ d ]) 4)))
            (nil))))
the (plus:SI ...) must always evaluate to (const_int 0).
And (reg:SI 94) is also (const_int 0), so the GEU comparison in jump_insn 21 is
always true.

On the other side, the original comparison in *.optimized dump this is emitted
for is if (d <= 1), which for d being either -1ULL or 0ULL isn't always true.

Reply via email to