[Bug tree-optimization/94913] Failure to optimize not+cmp into overflow check

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed May 6 15:35:07 GMT 2020


--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Uros Bizjak <uros@gcc.gnu.org>:


commit r11-145-g7c2879301d3b027a1ba427a5d5c7557decb8a7ab
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Wed May 6 17:33:51 2020 +0200

    i386: Use ADD to implement compares with negated operand [PR94913]

    Use carry flag from addition to implement GEU/LTU compares
    with negated operand, so e.g.

            ~x < y

    compiles to:

            addq    %rsi, %rdi
            setc    %al

    instead of:

            notq    %rdi
            cmpq    %rsi, %rdi
            setb    %al

            PR target/94913
            * config/i386/predicates.md (add_comparison_operator): New
            * config/i386/i386.md (compare->add splitter): New splitters.


            PR target/94913
            * gcc.target/i386/pr94913-1.c: New test.
            * gcc.target/i386/pr94913-2.c: Ditto.

More information about the Gcc-bugs mailing list