]> gcc.gnu.org Git - gcc.git/commit
tree: Fix up get_narrower [PR96549]
authorJakub Jelinek <jakub@redhat.com>
Tue, 11 Aug 2020 11:46:14 +0000 (13:46 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 25 Aug 2020 14:53:36 +0000 (16:53 +0200)
commitdb00336a49707327552e678b59da8e85384bdae6
tree8d81f1633d69dea88022b066280d882a0a6bb48a
parentaaac798d29acb61ab510c6106d10fc641becfcb7
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)
gcc/testsuite/gcc.c-torture/execute/pr96549.c [new file with mode: 0644]
gcc/tree.c
This page took 0.070841 seconds and 5 git commands to generate.