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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Uroš Bizjak from comment #5)
> So, we have:
> 
> Trying 15 -> 16:
>    15: flags:CCNO=cmp(r115:SI,0)
>       REG_DEAD r115:SI
>    16: r106:QI=flags:CCNO>0
> Successfully matched this instruction:
> (set (reg:CCNO 17 flags)
>     (compare:CCNO (reg:SI 115 [ _1 ])
>         (const_int 0 [0])))
> Successfully matched this instruction:
> (set (reg:QI 106 [ _37 ])
>     (subreg:QI (reg:SI 115 [ _1 ]) 0))
> 
> Which I don't think is correct.

That looks correct to me.
r115 was set by
(insn 10 9 11 3 (set (reg:QI 116)
        (eq:QI (reg:CCZ 17 flags)
            (const_int 0 [0]))) "/app/example.cpp":15:16 1452 {*setcc_qi}
     (expr_list:REG_DEAD (reg:CCZ 17 flags)
        (nil)))
(insn 11 10 15 3 (set (reg:SI 115 [ _1 ])
        (zero_extend:SI (reg:QI 116))) "/app/example.cpp":15:16 180
{*zero_extendqisi2}
     (expr_list:REG_DEAD (reg:QI 116)
        (nil)))

So r115's value will be 0 or 1 (STORE_FLAG_VALUE) so (gt:QI r115 0) is the same
as (subreg:QI r115). Unless I am missing something here.

Reply via email to