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.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/java/java-gimplify.c b/gcc/java/java-gimplify.c
index 54900d3f9ab..76d299f947f 100644
--- a/gcc/java/java-gimplify.c
+++ b/gcc/java/java-gimplify.c
@@ -120,6 +120,9 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
*expr_p = java_replace_reference (*expr_p, /* want_lvalue */ false);
return GS_UNHANDLED;
+ /* We don't handle GIMPLE_MODIFY_STMT, as MODIFY_EXPRs with java
+ 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);
@@ -326,7 +329,7 @@ java_gimplify_modify_expr (tree *modify_expr_p, tree *pre_p, tree *post_p)
{
tree new_lhs = java_replace_reference (lhs, /* want_lvalue */ true);
tree new_rhs = build1 (NOP_EXPR, TREE_TYPE (new_lhs), rhs);
- modify_expr = build2 (MODIFY_EXPR, TREE_TYPE (new_lhs),
+ modify_expr = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (new_lhs),
new_lhs, new_rhs);
modify_expr = build1 (NOP_EXPR, lhs_type, modify_expr);
}
@@ -424,7 +427,7 @@ java_gimplify_new_array_init (tree exp)
tree array_ptr_type = build_pointer_type (array_type);
tree tmp = create_tmp_var (array_ptr_type, "array");
- tree body = build2 (MODIFY_EXPR, array_ptr_type, tmp,
+ tree body = build2 (GIMPLE_MODIFY_STMT, array_ptr_type, tmp,
build_new_array (element_type, length));
int index = 0;
@@ -437,7 +440,7 @@ java_gimplify_new_array_init (tree exp)
tree lhs = build3 (COMPONENT_REF, TREE_TYPE (data_field),
build_java_indirect_ref (array_type, tmp, 0),
data_field, NULL_TREE);
- tree assignment = build2 (MODIFY_EXPR, element_type,
+ tree assignment = build2 (GIMPLE_MODIFY_STMT, element_type,
build4 (ARRAY_REF, element_type, lhs,
build_int_cst (NULL_TREE, index++),
NULL_TREE, NULL_TREE),