aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorAndrew Haley <aph@gcc.gnu.org>2005-08-11 11:49:26 +0000
committerAndrew Haley <aph@gcc.gnu.org>2005-08-11 11:49:26 +0000
commit74b002ba34f1d63cc0130ad44076b462477c631f (patch)
treee46af18516f27005e93dd98e1559b369c63fe67e /gcc/java
parenteb2b0cc0edabaf4b09d32a4ff011cd99c201c9db (diff)
downloadgcc-74b002ba34f1d63cc0130ad44076b462477c631f.zip
gcc-74b002ba34f1d63cc0130ad44076b462477c631f.tar.gz
gcc-74b002ba34f1d63cc0130ad44076b462477c631f.tar.bz2
[multiple changes]
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 From-SVN: r102988
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog11
-rw-r--r--gcc/java/java-gimplify.c16
-rw-r--r--gcc/java/parse.y3
3 files changed, 23 insertions, 7 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 01d9a91..17999a0 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,14 @@
+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
+
2005-08-08 Nathan Sidwell <nathan@codesourcery.com>
* class.c (build_class_ref): Wrap the primary class type in a
diff --git a/gcc/java/java-gimplify.c b/gcc/java/java-gimplify.c
index cbc174d..a07e1bb 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;
}
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 82c156e..363d074 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -10945,7 +10945,8 @@ maybe_use_access_method (int is_super_init, tree *mdecl, tree *this_arg)
invoking a static method. Note that if MD's type is unrelated to
CURRENT_CLASS, then the current this can be used. */
- if (non_static_context && DECL_CONTEXT (md) != object_type_node)
+ if (non_static_context
+ && !inherits_from_p (current_class, DECL_CONTEXT (md)))
{
ctx = TREE_TYPE (DECL_CONTEXT (TYPE_NAME (current_class)));
if (inherits_from_p (ctx, DECL_CONTEXT (md)))