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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-10-17
     Ever confirmed|0                           |1
           Severity|normal                      |enhancement

--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> ---
This optimization builds on the equivalence of:

        cmpl    $0, %edi
        sete    %al

where zero flag is used to set %al and

        cmpl    $1, %edi
        setc    %al

where carry flag is set to the "borrow" from the unsigned subtract of the $1
from %edi. The carry flag (aka "borrow") is set only for (0 - 1), when %edi ==
0.


The above conversion is beneficial when the following insn consumes carry flag
(e.g. adc/sbb, but also rcr and rcl).

IMO, the combine pass should be the most appropriate place for the above
transformation.

Reply via email to