diff options
author | Andrew Haley <aph@redhat.com> | 2005-03-04 15:38:13 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2005-03-04 15:38:13 +0000 |
commit | 7235c3007d0da74919e1399cfab838b03b6f8c3b (patch) | |
tree | 1673d4dd26e1d5a4f1b5ea444dae3777284ffdb6 /gcc/java | |
parent | 730967114bbf3cc902659a26cf43e5005c86977a (diff) | |
download | gcc-7235c3007d0da74919e1399cfab838b03b6f8c3b.zip gcc-7235c3007d0da74919e1399cfab838b03b6f8c3b.tar.gz gcc-7235c3007d0da74919e1399cfab838b03b6f8c3b.tar.bz2 |
re PR java/18362 (internal compiler error: in size_binop, at fold-const.c:1598)
2005-03-04 Andrew Haley <aph@redhat.com>
PR java/18362
* class.c (set_method_index): Don't set method_index if it is
NULL_TREE.
(layout_class_method): Don't complain about "non-static method foo
overrides static method" in the case of indirect dispatch.
From-SVN: r95888
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/java/class.c | 20 |
2 files changed, 22 insertions, 8 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 0fd4364..cee0acb 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,11 @@ +2005-03-04 Andrew Haley <aph@redhat.com> + + PR java/18362 + * class.c (set_method_index): Don't set method_index if it is + NULL_TREE. + (layout_class_method): Don't complain about "non-static method foo + overrides static method" in the case of indirect dispatch. + 2005-03-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * jcf-io.c (caching_stat): Use __extension__ to avoid pedantic @@ -59,7 +67,7 @@ PR java/19907 * expr.c (expand_byte_code): Call promote_arguments(). (promote_arguments): New function. - * decl.c (check_local_unnamed_variable): Remve special case for + * decl.c (check_local_unnamed_variable): Remove special case for new verifier. (find_local_variable): Promote all boolean types to int when searching for local variable decls. diff --git a/gcc/java/class.c b/gcc/java/class.c index 53a31e9..5e2e535 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -1476,14 +1476,19 @@ get_dispatch_table (tree type, tree this_class_addr) void set_method_index (tree decl, tree method_index) { - method_index = fold (convert (sizetype, method_index)); + if (method_index != NULL_TREE) + { + /* method_index is null if we're using indirect dispatch. */ + method_index = fold (convert (sizetype, method_index)); - if (TARGET_VTABLE_USES_DESCRIPTORS) - /* Add one to skip bogus descriptor for class and GC descriptor. */ - method_index = size_binop (PLUS_EXPR, method_index, size_int (1)); - else - /* Add 1 to skip "class" field of dtable, and 1 to skip GC descriptor. */ - method_index = size_binop (PLUS_EXPR, method_index, size_int (2)); + if (TARGET_VTABLE_USES_DESCRIPTORS) + /* Add one to skip bogus descriptor for class and GC descriptor. */ + method_index = size_binop (PLUS_EXPR, method_index, size_int (1)); + else + /* Add 1 to skip "class" field of dtable, and 1 to skip GC + descriptor. */ + method_index = size_binop (PLUS_EXPR, method_index, size_int (2)); + } DECL_VINDEX (decl) = method_index; } @@ -2357,6 +2362,7 @@ layout_class_method (tree this_class, tree super_class, tree method_index = get_method_index (super_method); set_method_index (method_decl, method_index); if (method_index == NULL_TREE + && ! flag_indirect_dispatch && !CLASS_FROM_SOURCE_P (this_class) && ! DECL_ARTIFICIAL (super_method)) error ("%Jnon-static method '%D' overrides static method", |