This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/14231] [3.4/3.5 Regression]Incorrect interface method called when compiling against .class files
- From: "aph at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Feb 2004 21:03:11 -0000
- Subject: [Bug java/14231] [3.4/3.5 Regression]Incorrect interface method called when compiling against .class files
- References: <20040221021434.14231.daney@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From aph at gcc dot gnu dot org 2004-02-23 21:03 -------
From: Andrew Haley <aph@redhat.com>
To: David Daney <ddaney@avtrex.com>
Cc: java@gcc.gnu.org
Subject: Method call via interface calls wrong method...
Date: Mon, 23 Feb 2004 21:00:34 +0000
David Daney writes:
> I found a bug with GCJ 3.4.0 configured for mipsel-linux and would like
> someone to try the same thing on x86-linux to see if it is target dependent.
>
> The bug report is here:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14231
>
> I think the test case is self explanatory.
Thanks for an excellent test case.
Joy! Another Miranda bug: we mark interfaces as abstract, but Sun
don't. Every interface is implicitly abstract, however.
Try this. Let me know if it fixes your problem.
Andrew.
2004-02-23 Andrew Haley <aph@redhat.com>
* class.c (layout_class_methods): Check for CLASS_INTERFACE as
well as CLASS_ABSTRACT.
Index: class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.176
diff -p -2 -c -r1.176 class.c
*** class.c 15 Jan 2004 10:24:25 -0000 1.176
--- class.c 23 Feb 2004 20:55:22 -0000
*************** layout_class_methods (tree this_class)
*** 2054,2058 ****
{
tree method_decl, dtable_count;
! tree super_class;
if (TYPE_NVIRTUALS (this_class))
--- 2074,2078 ----
{
tree method_decl, dtable_count;
! tree super_class, type_name;
if (TYPE_NVIRTUALS (this_class))
*************** layout_class_methods (tree this_class)
*** 2071,2075 ****
dtable_count = integer_zero_node;
! if (CLASS_ABSTRACT (TYPE_NAME (this_class)))
{
/* An abstract class can have methods which are declared only in
--- 2091,2096 ----
dtable_count = integer_zero_node;
! type_name = TYPE_NAME (this_class);
! if (CLASS_ABSTRACT (type_name) || CLASS_INTERFACE (type_name))
{
/* An abstract class can have methods which are declared only in
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |aph at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14231