summaryrefslogtreecommitdiff
path: root/gcc/java/java-gimplify.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java/java-gimplify.c')
-rw-r--r--gcc/java/java-gimplify.c93
1 files changed, 3 insertions, 90 deletions
diff --git a/gcc/java/java-gimplify.c b/gcc/java/java-gimplify.c
index 091cb1b875f..53582411353 100644
--- a/gcc/java/java-gimplify.c
+++ b/gcc/java/java-gimplify.c
@@ -32,8 +32,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "toplev.h"
static tree java_gimplify_block (tree);
-static enum gimplify_status java_gimplify_modify_expr (tree*, tree*, tree *);
-static enum gimplify_status java_gimplify_component_ref (tree*, tree*, tree *);
+static enum gimplify_status java_gimplify_modify_expr (tree *);
static enum gimplify_status java_gimplify_self_mod_expr (tree*, tree*, tree *);
static void dump_java_tree (enum tree_dump_index, tree);
@@ -73,7 +72,7 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
semantics should only be generated by the front-end, and never
by anything after gimplification. */
case MODIFY_EXPR:
- return java_gimplify_modify_expr (expr_p, pre_p, post_p);
+ return java_gimplify_modify_expr (expr_p);
case SAVE_EXPR:
/* Note that we can see <save_expr NULL> if the save_expr was
@@ -98,9 +97,6 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
case COMPARE_G_EXPR:
gcc_unreachable ();
- case COMPONENT_REF:
- return java_gimplify_component_ref (expr_p, pre_p, post_p);
-
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
@@ -129,96 +125,13 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
}
static enum gimplify_status
-java_gimplify_component_ref (tree *expr_p, tree *pre_p, tree *post_p)
-{
- if (CLASS_FROM_SOURCE_P (output_class)
- && TREE_THIS_VOLATILE (TREE_OPERAND (*expr_p, 1))
- && ! TREE_THIS_VOLATILE (*expr_p))
- {
- enum gimplify_status stat;
- tree sync_expr;
-
- /* Special handling for volatile fields.
-
- A load has "acquire" semantics, implying that you can't move up
- later operations. A store has "release" semantics meaning that
- earlier operations cannot be delayed past it.
-
- This logic only handles loads: stores are handled in
- java_gimplify_modify_expr().
-
- We gimplify this COMPONENT_REF, put the result in a tmp_var, and then
- return a COMPOUND_EXPR of the form {__sync_synchronize(); tmp_var}.
- This forces __sync_synchronize() to be placed immediately after
- loading from the volatile field.
-
- */
-
- TREE_THIS_VOLATILE (*expr_p) = 1;
- *expr_p = java_modify_addr_for_volatile (*expr_p);
- stat = gimplify_expr (expr_p, pre_p, post_p,
- is_gimple_formal_tmp_var, fb_rvalue);
- if (stat == GS_ERROR)
- return stat;
-
- sync_expr = build_call_expr (built_in_decls[BUILT_IN_SYNCHRONIZE], 0);
- TREE_SIDE_EFFECTS (sync_expr) = 1;
- *expr_p = build2 (COMPOUND_EXPR, TREE_TYPE (*expr_p),
- sync_expr, *expr_p);
- TREE_SIDE_EFFECTS (*expr_p) = 1;
- }
-
- return GS_UNHANDLED;
-}
-
-
-static enum gimplify_status
-java_gimplify_modify_expr (tree *modify_expr_p, tree *pre_p, tree *post_p)
+java_gimplify_modify_expr (tree *modify_expr_p)
{
tree modify_expr = *modify_expr_p;
tree lhs = TREE_OPERAND (modify_expr, 0);
tree rhs = TREE_OPERAND (modify_expr, 1);
tree lhs_type = TREE_TYPE (lhs);
- if (CLASS_FROM_SOURCE_P (output_class)
- && TREE_CODE (lhs) == COMPONENT_REF
- && TREE_THIS_VOLATILE (TREE_OPERAND (lhs, 1)))
- {
- /* Special handling for volatile fields.
-
- A load has "acquire" semantics, implying that you can't move up
- later operations. A store has "release" semantics meaning that
- earlier operations cannot be delayed past it.
-
- This logic only handles stores; loads are handled in
- java_gimplify_component_ref().
-
- We gimplify the rhs, put the result in a tmp_var, and then return
- a MODIFY_EXPR with an rhs of the form {__sync_synchronize(); tmp_var}.
- This forces __sync_synchronize() to be placed after evaluating
- the rhs and immediately before storing to the volatile field.
-
- */
-
- enum gimplify_status stat;
- tree sync_expr =
- build_call_expr (built_in_decls[BUILT_IN_SYNCHRONIZE], 0);
- TREE_SIDE_EFFECTS (sync_expr) = 1;
-
- stat = gimplify_expr (&rhs, pre_p, post_p,
- is_gimple_formal_tmp_var, fb_rvalue);
- if (stat == GS_ERROR)
- return stat;
-
- rhs = build2 (COMPOUND_EXPR, TREE_TYPE (rhs),
- sync_expr, rhs);
- TREE_SIDE_EFFECTS (rhs) = 1;
- TREE_THIS_VOLATILE (lhs) = 1;
- lhs = java_modify_addr_for_volatile (lhs);
- TREE_OPERAND (modify_expr, 0) = lhs;
- TREE_OPERAND (modify_expr, 1) = rhs;
- }
-
/* This is specific to the bytecode compiler. If a variable has
LOCAL_SLOT_P set, replace an assignment to it with an assignment
to the corresponding variable that holds all its aliases. */