diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-18 07:46:33 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-18 07:46:33 +0000 |
commit | d471893dcbdfab38ec021b746517d648db7dbb42 (patch) | |
tree | 699c6e9907b0c33f5cd057a408e8a232bd118ec9 /gcc/java/java-gimplify.c | |
parent | b4a82ea7cc767f1abe921b835ff0324c082a8231 (diff) | |
download | gcc-d471893dcbdfab38ec021b746517d648db7dbb42.tar.gz |
* tree.h (struct tree_decl): Add gimple_formal_temp.
(DECL_GIMPLE_FORMAL_TEMP_P): New.
* gimplify.c (pop_gimplify_context): Clear it.
(lookup_tmp_var): Set it, if is_formal.
(gimplify_init_constructor): Use rhs_predicate_for for COMPLEX.
Use is_gimple_val for VECTOR. Simplify return value.
(gimplify_save_expr): Use and set DECL_GIMPLE_FORMAL_TEMP_P.
(gimplify_expr): Likewise.
* tree-gimple.c (is_gimple_formal_tmp_rhs): Rename from
is_gimple_tmp_rhs for clarity. Update all callers.
(is_gimple_reg_rhs): Simplify logic.
(is_gimple_formal_tmp_var): Rename from is_gimple_tmp_var for
clarity; use DECL_GIMPLE_FORMAL_TEMP_P.
(is_gimple_formal_tmp_reg): Similarly.
* tree-gimple.h: Update decls.
* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Use
DECL_IGNORED_P, not DECL_ARTIFICIAL. Tidy formatting.
* tree-ssa-live.c (var_union, type_var_init): Likewise.
java/
* java-gimplify.c (java_gimplify_expr): Move '2' handling into
default case. Treat '<' similarly. Update for
is_gimple_formal_tmp_var name change.
testsuite/
* gcc.dg/20040206-1.c: XFAIL.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86176 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/java-gimplify.c')
-rw-r--r-- | gcc/java/java-gimplify.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/gcc/java/java-gimplify.c b/gcc/java/java-gimplify.c index 094555938d9..ea1b3f0bd65 100644 --- a/gcc/java/java-gimplify.c +++ b/gcc/java/java-gimplify.c @@ -60,28 +60,9 @@ int java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED, tree *post_p ATTRIBUTE_UNUSED) { - char code_class = TREE_CODE_CLASS(TREE_CODE (*expr_p)); - - /* Java insists on strict left-to-right evaluation of expressions. - A problem may arise if a variable used in the LHS of a binary - operation is altered by an assignment to that value in the RHS - before we've performed the operation. So, we always copy every - LHS to a temporary variable. - - FIXME: Are there any other cases where we should do this? - Parameter lists, maybe? Or perhaps that's unnecessary because - the front end already generates SAVE_EXPRs. */ - if (code_class == '2') - { - tree lhs = TREE_OPERAND (*expr_p, 0); - enum gimplify_status stat - = gimplify_expr (&lhs, pre_p, post_p, is_gimple_tmp_var, fb_rvalue); - if (stat == GS_ERROR) - return stat; - TREE_OPERAND (*expr_p, 0) = lhs; - } + enum tree_code code = TREE_CODE (*expr_p); - switch (TREE_CODE (*expr_p)) + switch (code) { case BLOCK: *expr_p = java_gimplify_block (*expr_p); @@ -150,6 +131,25 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED, abort (); default: + /* Java insists on strict left-to-right evaluation of expressions. + A problem may arise if a variable used in the LHS of a binary + operation is altered by an assignment to that value in the RHS + before we've performed the operation. So, we always copy every + LHS to a temporary variable. + + FIXME: Are there any other cases where we should do this? + Parameter lists, maybe? Or perhaps that's unnecessary because + the front end already generates SAVE_EXPRs. */ + + if (TREE_CODE_CLASS (code) == '2' || TREE_CODE_CLASS (code) == '<') + { + enum gimplify_status stat + = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p, + is_gimple_formal_tmp_var, fb_rvalue); + if (stat == GS_ERROR) + return stat; + } + return GS_UNHANDLED; } |