aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2005-08-16 16:06:43 +0000
committerTom Tromey <tromey@gcc.gnu.org>2005-08-16 16:06:43 +0000
commit33173fd40fa6fa47d85c9dfa169ad4dcb3916a3b (patch)
tree7c0b6e95a8ebdb28fbcfca41cd2acb48d5f938f6 /gcc/java
parentce45ef468cb3183890e4a159b9757bf640216558 (diff)
downloadgcc-33173fd40fa6fa47d85c9dfa169ad4dcb3916a3b.zip
gcc-33173fd40fa6fa47d85c9dfa169ad4dcb3916a3b.tar.gz
gcc-33173fd40fa6fa47d85c9dfa169ad4dcb3916a3b.tar.bz2
re PR java/23300 (DECL_FIELD_OFFSET == 0 versus build_field_ref)
PR java/23300. * expr.c (build_field_ref): Don't generate otable reference when DECL_FIELD_OFFSET is 0. * class.c (maybe_layout_super_class): Pass outer class to do_resolve_class. From-SVN: r103160
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog8
-rw-r--r--gcc/java/class.c5
-rw-r--r--gcc/java/expr.c8
3 files changed, 12 insertions, 9 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index f6c6915..b21f082 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,5 +1,13 @@
2005-08-15 Tom Tromey <tromey@redhat.com>
+ PR java/23300.
+ * expr.c (build_field_ref): Don't generate otable reference when
+ DECL_FIELD_OFFSET is 0.
+ * class.c (maybe_layout_super_class): Pass outer class to
+ do_resolve_class.
+
+2005-08-15 Tom Tromey <tromey@redhat.com>
+
* java-tree.h (LABEL_IN_SUBR): Removed.
(LABEL_IN_SUBR): Likewise.
(LABEL_IS_SUBR_START): Likewise.
diff --git a/gcc/java/class.c b/gcc/java/class.c
index d7e22c2..21945eb 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -2093,8 +2093,9 @@ maybe_layout_super_class (tree super_class, tree this_class)
DECL_SOURCE_LINE (this_decl), 0);
#endif
}
- super_class = do_resolve_class (NULL_TREE, this_class,
- super_class, NULL_TREE, this_wrap);
+ super_class
+ = do_resolve_class (DECL_CONTEXT (TYPE_NAME (this_class)),
+ this_class, super_class, NULL_TREE, this_wrap);
if (!super_class)
return NULL_TREE; /* FIXME, NULL_TREE not checked by caller. */
super_class = TREE_TYPE (super_class);
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index c5e48a8..c29b8a3 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -1688,13 +1688,7 @@ build_field_ref (tree self_value, tree self_class, tree name)
tree base_type = promote_type (base_class);
if (base_type != TREE_TYPE (self_value))
self_value = fold (build1 (NOP_EXPR, base_type, self_value));
- if (! flag_syntax_only
- && (flag_indirect_dispatch
- /* DECL_FIELD_OFFSET == 0 if we have no reference for
- the field, perhaps because we couldn't find the class
- in which the field is defined.
- FIXME: We should investigate this. */
- || DECL_FIELD_OFFSET (field_decl) == 0))
+ if (! flag_syntax_only && flag_indirect_dispatch)
{
tree otable_index
= build_int_cst (NULL_TREE, get_symbol_table_index