]> git.ipfire.org Git - thirdparty/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)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 18:07:58 +0000 (15:07 -0300)
commitb76a9e0d9e1a2240c1c955461e58297aea066cca
tree5041757945f973d415b36f4772bf8760c841d599
parent72bffce616a841ba03d5bba68bc2c650c5e2a83d
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.
gcc/testsuite/gcc.c-torture/execute/pr96549.c [new file with mode: 0644]
gcc/tree.c