x
* parse.y (java_complete_lhs): Call force_evaluation_order
after patch_newarray.
(patch_binop): Don't call fold if there are side effects.
From-SVN: r25807
/* They complete the array creation expression, if no errors
were found. */
CAN_COMPLETE_NORMALLY (node) = 1;
- return (flag ? error_mark_node : patch_newarray (node));
+ return (flag ? error_mark_node
+ : force_evaluation_order (patch_newarray (node)));
case NEW_CLASS_EXPR:
case CALL_EXPR:
TREE_TYPE (node) = prom_type;
TREE_SIDE_EFFECTS (node) = TREE_SIDE_EFFECTS (op1) | TREE_SIDE_EFFECTS (op2);
- return fold (node);
+ /* fold does not respect side-effect order as required for Java but not C. */
+ if (! TREE_SIDE_EFFECTS (node))
+ node = fold (node);
+ return node;
}
/* Concatenate the STRING_CST CSTE and STRING. When AFTER is a non