On Fri, 22 Dec 2017, Jakub Jelinek wrote: > Hi! > > The recent change to clear TREE_SIDE_EFFECTS on STATEMENT_LIST containing > DEBUG_BEGIN_STMTs and a single other statement without TREE_SIDE_EFFECTS on > it breaks the C stmt expr handling. The problem is that it assumes if > TREE_SIDE_EFFECTS is clear on a STATEMENT_LIST then that means the > STATEMENT_LIST is empty, i.e. ({ }), which is no longer the case. > > Fixed by skipping over DEBUG_BEGIN_STMTs from the tail to find the last > non-DEBUG_BEGIN_STMT stmt (if any, and if none, treat it like ({ }) ), > and also not processing the last non-DEBUG_BEGIN_STMT for -Wunused-value > if it is followed by DEBUG_BEGIN_STMTs. > > In addition to this, the patch includes a fix from my earlier patch, where > alloc_stmt_list TREE_SIDE_EFFECTS bit is inconsistent, depending on whether > it is reused from the cache (then TREE_SIDE_EFFECTS was clear), or newly > allocated (then it was set). > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
OK. (This looks the issue causing glibc builds with current mainline to fall over <https://sourceware.org/ml/libc-testresults/2017-q4/msg00538.html>.) -- Joseph S. Myers jos...@codesourcery.com