diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-12-22 19:01:58 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-12-22 19:01:58 +0100 |
commit | 11d29d639f4b60f51a593932529be6895b613d4c (patch) | |
tree | 55a89f9b5c3f9d9950784154e055bf77d09d5457 /gcc/tree-iterator.c | |
parent | d7727ce400380aaf26fb915d31dcbd98a761e2c0 (diff) | |
download | gcc-11d29d639f4b60f51a593932529be6895b613d4c.zip gcc-11d29d639f4b60f51a593932529be6895b613d4c.tar.gz gcc-11d29d639f4b60f51a593932529be6895b613d4c.tar.bz2 |
re PR debug/83547 ((statement-frontiers) error: void value not ignored as it ought to be)
PR debug/83547
* tree-iterator.c (alloc_stmt_list): Start with cleared
TREE_SIDE_EFFECTS regardless whether a new STATEMENT_LIST is allocated
or old one reused.
c/
* c-typeck.c (c_finish_stmt_expr): Ignore !TREE_SIDE_EFFECTS as
indicator of ({ }), instead skip all trailing DEBUG_BEGIN_STMTs first,
and consider empty ones if there are no other stmts. For
-Wunused-value walk all statements before the one only followed by
DEBUG_BEGIN_STMTs.
testsuite/
* gcc.c-torture/compile/pr83547.c: New test.
From-SVN: r255980
Diffstat (limited to 'gcc/tree-iterator.c')
-rw-r--r-- | gcc/tree-iterator.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-iterator.c b/gcc/tree-iterator.c index 10e510d..b0b88f4 100644 --- a/gcc/tree-iterator.c +++ b/gcc/tree-iterator.c @@ -41,7 +41,10 @@ alloc_stmt_list (void) TREE_SET_CODE (list, STATEMENT_LIST); } else - list = make_node (STATEMENT_LIST); + { + list = make_node (STATEMENT_LIST); + TREE_SIDE_EFFECTS (list) = 0; + } TREE_TYPE (list) = void_type_node; return list; } |