summaryrefslogtreecommitdiff
path: root/gcc/java/java-gimplify.c
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-11 11:49:26 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-11 11:49:26 +0000
commit930d6081ba8ccd057ebc90ea805e108bb6000690 (patch)
treee46af18516f27005e93dd98e1559b369c63fe67e /gcc/java/java-gimplify.c
parentf1046c0def2e0cda104418759b1610f38be625b2 (diff)
downloadgcc-930d6081ba8ccd057ebc90ea805e108bb6000690.tar.gz
2005-08-10 Andrew Haley <aph@redhat.com>
* java-gimplify.c (java_gimplify_modify_expr): Fix any pointer type mismatches to make legal GIMPLE. 2005-08-10 Robin Green <greenrd@greenrd.org> PR java/23230: * parse.y (maybe_use_access_method): Generalize check from java.lang.Object to any superclass of current_class git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102988 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/java-gimplify.c')
-rw-r--r--gcc/java/java-gimplify.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/java/java-gimplify.c b/gcc/java/java-gimplify.c
index cbc174d8f02..a07e1bbdc96 100644
--- a/gcc/java/java-gimplify.c
+++ b/gcc/java/java-gimplify.c
@@ -208,17 +208,16 @@ java_gimplify_exit_block_expr (tree expr)
return build1 (GOTO_EXPR, void_type_node, label);
}
-/* 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. */
-
static tree
java_gimplify_modify_expr (tree modify_expr)
{
tree lhs = TREE_OPERAND (modify_expr, 0);
tree rhs = TREE_OPERAND (modify_expr, 1);
tree lhs_type = TREE_TYPE (lhs);
-
+
+ /* 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. */
if (TREE_CODE (lhs) == VAR_DECL
&& DECL_LANG_SPECIFIC (lhs)
&& LOCAL_SLOT_P (lhs)
@@ -230,7 +229,12 @@ java_gimplify_modify_expr (tree modify_expr)
new_lhs, new_rhs);
modify_expr = build1 (NOP_EXPR, lhs_type, modify_expr);
}
-
+ else if (lhs_type != TREE_TYPE (rhs))
+ /* Fix up type mismatches to make legal GIMPLE. These are
+ generated in several places, in particular null pointer
+ assignment and subclass assignment. */
+ TREE_OPERAND (modify_expr, 1) = convert (lhs_type, rhs);
+
return modify_expr;
}