diff options
| author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-28 04:56:35 +0000 |
|---|---|---|
| committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-28 04:56:35 +0000 |
| commit | 3541e1130504244cf334a9d3f471377bd276c949 (patch) | |
| tree | 59d5e4829907404d9cd123482f4ad1565deac1eb /gcc/java/expr.c | |
| parent | eb32e911e2e75329903d38e72ff207ede5ca722c (diff) | |
| download | ppe42-gcc-3541e1130504244cf334a9d3f471377bd276c949.tar.gz ppe42-gcc-3541e1130504244cf334a9d3f471377bd276c949.zip | |
* toplev.c (flag_evaluation_order): New global variable.
* flags.h (flag_evaluation_order): Prototype here.
* expr.c (expand_operands): If we need to preserve observable
evaluation order, protect exp1 from clobbering exp0's result.
* java/lang.c (java_init_options): Set flag_evaluation_order.
* java/expr.c (force_evaluation_order): Don't attempt to force
evaluation order of binary operations using save_expr.
* java/parse.y (java_complete_lhs): No longer need to call
force_evaluation_order when constructing binary operators.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71873 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/expr.c')
| -rw-r--r-- | gcc/java/expr.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c index 803c2deff83..272cb351e78 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -3324,16 +3324,11 @@ force_evaluation_order (tree node) { if (flag_syntax_only) return node; - if (TREE_CODE_CLASS (TREE_CODE (node)) == '2') - { - if (TREE_SIDE_EFFECTS (TREE_OPERAND (node, 1))) - TREE_OPERAND (node, 0) = save_expr (TREE_OPERAND (node, 0)); - } - else if (TREE_CODE (node) == CALL_EXPR - || TREE_CODE (node) == NEW_CLASS_EXPR - || (TREE_CODE (node) == COMPOUND_EXPR - && TREE_CODE (TREE_OPERAND (node, 0)) == CALL_EXPR - && TREE_CODE (TREE_OPERAND (node, 1)) == SAVE_EXPR)) + if (TREE_CODE (node) == CALL_EXPR + || TREE_CODE (node) == NEW_CLASS_EXPR + || (TREE_CODE (node) == COMPOUND_EXPR + && TREE_CODE (TREE_OPERAND (node, 0)) == CALL_EXPR + && TREE_CODE (TREE_OPERAND (node, 1)) == SAVE_EXPR)) { tree arg, cmp; |

