On Fri, Jul 08, 2011 at 05:49:36PM -0400, Jason Merrill wrote: > The C++ sequence point rules for compound assignment (+= and such) > are slightly different from those for C: the value of the LHS is not > loaded until after the RHS value (and LHS location) are evaluated. > Since we don't have tree codes for compound assignment, I need to > handle this in C++ by preevaluating the RHS into a temporary. Doing > this breaks various gomp tests because the logic for recognizing > compound assignment gets confused by the COMPOUND_EXPR, so I've > adjusted the appropriate omp code appropriately. > > Tested x86_64-pc-linux-gnu, OK for trunk?
Ok. > commit cec1fed71c8cf44b26fbb80546b1c2dd3780ebe1 > Author: Jason Merrill <ja...@redhat.com> > Date: Fri Jul 8 14:07:23 2011 -0400 > > PR c++/45437 > gcc/ > * gimplify.c (goa_stabilize_expr): Handle RHS preevaluation in > compound assignment. > gcc/c-family/ > * c-omp.c (check_omp_for_incr_expr): Handle preevaluation. > gcc/cp/ > * typeck.c (cp_build_modify_expr): Preevaluate RHS. Jakub