On 02/22/2013 09:53 AM, Aldy Hernandez wrote:
Frankly, I don't understand finish_transaction_stmt(), and why it sets TREE_SIDE_EFFECTS only if the [noexcept] clause is set. I'm C++ ignorant, but I would've thought the opposite to be true.
It's setting that flag on the MUST_NOT_THROW_EXPR.
Anyways, I've fixed the problem by setting TREE_SIDE_EFFECTS if the transaction body has side effects. Perhaps we should do this for build_transaction_expr() as well?
I would think managing the transaction boundaries would always have side-effects, no? If that's correct, I'd set the flag unconditionally in begin_transaction_stmt and build_transaction_expr.
Jason