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

--- Comment #7 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Author: aoliva
Date: Thu Dec 21 18:14:06 2017
New Revision: 255947

URL: https://gcc.gnu.org/viewcvs?rev=255947&root=gcc&view=rev
Log:
[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.

Added:
    trunk/gcc/testsuite/gcc.dg/pr83419.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-family/c-semantics.c
    trunk/gcc/testsuite/ChangeLog

Reply via email to