https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69211
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Mon Jan 11 17:59:22 2016 New Revision: 232237 URL: https://gcc.gnu.org/viewcvs?rev=232237&root=gcc&view=rev Log: PR c++/69211 * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR folded operands have side-effects, but folding changed any of them, build a new tree with the folded operands instead of returning the unfolded tree. * g++.dg/opt/pr69211.C: New test. Added: trunk/gcc/testsuite/g++.dg/opt/pr69211.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-gimplify.c trunk/gcc/testsuite/ChangeLog