[Bug middle-end/96549] [10 Regression] Wrong evaluation of a comparison between long & short

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Aug 25 17:45:12 GMT 2020


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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

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

commit r10-8665-gdb00336a49707327552e678b59da8e85384bdae6
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Aug 11 13:46:14 2020 +0200

    tree: Fix up get_narrower [PR96549]

    My changes to get_narrower to support COMPOUND_EXPRs apparently
    used a wrong type for the COMPOUND_EXPRs, while e.g. the rhs
    type was unsigned short, the COMPOUND_EXPR got int type as that was the
    original type of op.  The type of COMPOUND_EXPR should be always the type
    of the rhs.

    2020-08-11  Jakub Jelinek  <jakub@redhat.com>

            PR c/96549
            * tree.c (get_narrower): Use TREE_TYPE (ret) instead of
            TREE_TYPE (win) for COMPOUND_EXPRs.

            * gcc.c-torture/execute/pr96549.c: New test.

    (cherry picked from commit 6b815e113c9aec397a86d7194f66455eb189cc7a)


More information about the Gcc-bugs mailing list