+2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * java-tree.h (IS_INIT_CHECKED): New flag.
+ * check-init.c (check_init): Test and set IS_INIT_CHECKED.
+ * parse.y (patch_string): Call force_evaluation_order on the
+ completed string concatenation tree.
+ * expr.c (force_evaluation_order): Call force_evaluation_order on
+ function's arguments too.
+
Mon Mar 6 18:07:07 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* decl.c (emit_init_test_initialization): Mark KEY as unused.
case FIX_TRUNC_EXPR:
case INDIRECT_REF:
case ADDR_EXPR:
- case SAVE_EXPR:
case PREDECREMENT_EXPR:
case PREINCREMENT_EXPR:
case POSTDECREMENT_EXPR:
exp = TREE_OPERAND (exp, 0);
goto again;
+ case SAVE_EXPR:
+ if (IS_INIT_CHECKED (exp))
+ return;
+ IS_INIT_CHECKED (exp) = 1;
+ exp = TREE_OPERAND (exp, 0);
+ goto again;
+
case COMPOUND_EXPR:
case PLUS_EXPR:
case MINUS_EXPR:
for (cmp = NULL_TREE, arg = TREE_OPERAND (node, 1);
arg; arg = TREE_CHAIN (arg))
{
- tree saved = save_expr (TREE_VALUE (arg));
+ tree saved = save_expr (force_evaluation_order (TREE_VALUE (arg)));
cmp = (cmp == NULL_TREE ? saved :
build (COMPOUND_EXPR, void_type_node, cmp, saved));
TREE_VALUE (arg) = saved;
5: HAS_BEEN_ALREADY_PARSED_P (in IDENTIFIER_NODE)
IS_BREAK_STMT_P (in EXPR_WITH_FILE_LOCATION)
IS_CRAFTED_STRING_BUFFER_P (in CALL_EXPR)
+ IS_INIT_CHECKED (in SAVE_EXPR)
6: CAN_COMPLETE_NORMALLY (in statement nodes).
Usage of TYPE_LANG_FLAG_?:
/* True if EXPR (a CALL_EXPR in that case) is a crafted StringBuffer */
#define IS_CRAFTED_STRING_BUFFER_P(EXPR) TREE_LANG_FLAG_5 (EXPR)
+/* True if EXPR (a SAVE_EXPR in that case) had its content already
+ checked for (un)initialized local variables. */
+#define IS_INIT_CHECKED(EXPR) TREE_LANG_FLAG_5 (EXPR)
+
/* If set in CALL_EXPR, the receiver is 'super'. */
#define CALL_USING_SUPER(EXPR) TREE_LANG_FLAG_4 (EXPR)
/* Temporary disable forbid the use of `this'. */
ctxp->explicit_constructor_p = 0;
ret = java_complete_tree (make_qualified_primary (node, invoke, 0));
+ /* String concatenation arguments must be evaluated in order too. */
+ ret = force_evaluation_order (ret);
/* Restore it at its previous value */
ctxp->explicit_constructor_p = saved;
return ret;
/* Temporary disable forbid the use of `this'. */
ctxp->explicit_constructor_p = 0;
ret = java_complete_tree (make_qualified_primary (node, invoke, 0));
+ /* String concatenation arguments must be evaluated in order too. */
+ ret = force_evaluation_order (ret);
/* Restore it at its previous value */
ctxp->explicit_constructor_p = saved;
return ret;