[SFN] propagate single-nondebug-stmt's side effects to enclosing list
authorAlexandre Oliva <aoliva@redhat.com>
Thu, 21 Dec 2017 18:14:06 +0000 (18:14 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Thu, 21 Dec 2017 18:14:06 +0000 (18:14 +0000)
commitcb6332333854a698cbfc2ea4b1e52ce9bd59f664
tree1fc2746b579d67b45f98cfb65ac4f0839237650a
parent6b6d8f38f7b3bd8a2f4e4dbeb3014ba1339afa89
[SFN] propagate single-nondebug-stmt's side effects to enclosing list

Statements without side effects, preceded by debug begin stmt markers,
would become a statement list with side effects, although the stmt on
its own would be extracted from the list and remain not having side
effects.  This causes debug info and possibly codegen differences.
This patch fixes it, identifying the situation in which the stmt would
have been extracted from the stmt list, and propagating the side
effects flag from the stmt to the list.

for  gcc/ChangeLog

PR debug/83419
* c-family/c-semantics.c (pop_stmt_list): Propagate side
effects from single nondebug stmt to container list.

for  gcc/testsuite/ChangeLog

PR debug/83419
* gcc.dg/pr83419.c: New.

From-SVN: r255947
gcc/ChangeLog
gcc/c-family/c-semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr83419.c [new file with mode: 0644]