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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Eric Botcazou <ebotca...@gcc.gnu.org>:

https://gcc.gnu.org/g:c04bd12b06a21ad4a9c432c109ec2a543725ad1b

commit r11-5511-gc04bd12b06a21ad4a9c432c109ec2a543725ad1b
Author: Eric Botcazou <ebotca...@adacore.com>
Date:   Sat Nov 28 12:54:48 2020 +0100

    Fix PR target/97939

    The little dance around 4096 that add/sub instructions do on the SPARC
    needs to be taken into account for the overflow arithmetic operations.
    It cannot be done for unsigned overflow, but it can be done for signed
    overflow.

    gcc/ChangeLog:
            PR target/97939
            * config/sparc/predicates.md (arith_double_add_operand): Comment.
            * config/sparc/sparc.md (uaddvdi4): Use arith_double_operand.
            (addvdi4): Use arith_double_add_operand.
            (addsi3): Remove useless attributes.
            (addvsi4): Use arith_add_operand.
            (*cmp_ccv_plus): Likewise and add second alternative accordingly.
            (*cmp_ccxv_plus): Likewise.
            (*cmp_ccv_plus_set): Likewise.
            (*cmp_ccxv_plus_set): Likewise.
            (*cmp_ccv_plus_sltu_set): Likewise.
            (usubvdi4): Use arith_double_operand.
            (subvdi4): Use arith_double_add_operand.
            (subsi3): Remove useless attributes.
            (subvsi4): Use arith_add_operand.
            (*cmp_ccv_minus): Likewise and add second alternative accordingly.
            (*cmp_ccxv_minus): Likewise.
            (*cmp_ccv_minus_set): Likewise.
            (*cmp_ccxv_minus_set): Likewise.
            (*cmp_ccv_minus_sltu_set): Likewise.
            (negsi2): Use register_operand.
            (unegvsi3): Likewise.
            (negvsi3) Likewise.
            (*cmp_ccnz_neg): Likewise.
            (*cmp_ccxnz_neg): Likewise.
            (*cmp_ccnz_neg_set): Likewise.
            (*cmp_ccxnz_neg_set): Likewise.
            (*cmp_ccc_neg_set): Likewise.
            (*cmp_ccxc_neg_set): Likewise.
            (*cmp_ccc_neg_sltu_set): Likewise.
            (*cmp_ccv_neg): Likewise.
            (*cmp_ccxv_neg): Likewise.
            (*cmp_ccv_neg_set): Likewise.
            (*cmp_ccxv_neg_set): Likewise.
            (*cmp_ccv_neg_sltu_set): Likewise.

    gcc/testsuite/ChangeLog:
            * gcc.target/sparc/overflow-6.c: New test.

Reply via email to