diff options
author | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-06-19 17:38:08 +0000 |
---|---|---|
committer | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-06-19 17:38:08 +0000 |
commit | 9388e2a6c70fff14ced04fb309bad3072ae729f0 (patch) | |
tree | 3b4b80cba4b272464d1b60f8d164c7cd515a34ef /gcc/java/java-gimplify.c | |
parent | b463950830cbaf1767a8e1dce5f82feb5e8cb0f5 (diff) | |
download | gcc-9388e2a6c70fff14ced04fb309bad3072ae729f0.tar.gz |
2006-06-19 Andrew Haley <aph@redhat.com>
PR java/1305
PR java/27908
* expr.c (java_modify_addr_for_volatile): New function.
(expand_java_field_op): Handle volatile fields.
* java-gimplify.c (java_gimplify_component_ref): Call
java_modify_addr_for_volatile to give the field_ref the correct
volatile type.
(java_gimplify_modify_expr): Likewise.
* java-tree.h (java_modify_addr_for_volatile): New decl.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114778 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/java-gimplify.c')
-rw-r--r-- | gcc/java/java-gimplify.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/java/java-gimplify.c b/gcc/java/java-gimplify.c index 21c0641ab18..54900d3f9ab 100644 --- a/gcc/java/java-gimplify.c +++ b/gcc/java/java-gimplify.c @@ -223,7 +223,8 @@ java_gimplify_exit_block_expr (tree expr) static enum gimplify_status java_gimplify_component_ref (tree *expr_p, tree *pre_p, tree *post_p) { - if (TREE_THIS_VOLATILE (TREE_OPERAND (*expr_p, 1)) + if (CLASS_FROM_SOURCE_P (output_class) + && TREE_THIS_VOLATILE (TREE_OPERAND (*expr_p, 1)) && ! TREE_THIS_VOLATILE (*expr_p)) { enum gimplify_status stat; @@ -246,6 +247,7 @@ java_gimplify_component_ref (tree *expr_p, tree *pre_p, tree *post_p) */ 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) @@ -273,7 +275,8 @@ java_gimplify_modify_expr (tree *modify_expr_p, tree *pre_p, tree *post_p) tree rhs = TREE_OPERAND (modify_expr, 1); tree lhs_type = TREE_TYPE (lhs); - if (TREE_CODE (lhs) == COMPONENT_REF + if (CLASS_FROM_SOURCE_P (output_class) + && TREE_CODE (lhs) == COMPONENT_REF && TREE_THIS_VOLATILE (TREE_OPERAND (lhs, 1))) { /* Special handling for volatile fields. @@ -308,6 +311,7 @@ java_gimplify_modify_expr (tree *modify_expr_p, tree *pre_p, tree *post_p) 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; } |