public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/18868] New: Interface containing anonymous class breaks gij
@ 2004-12-07 13:20 steph at tangency dot co dot uk
  2004-12-07 13:24 ` [Bug java/18868] " konqueror at gmx dot de
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: steph at tangency dot co dot uk @ 2004-12-07 13:20 UTC (permalink / raw)
  To: java-prs

The following construct seems to have issues with gij (3.4 and 4.0) but works ok
with kaffe and jamvm (output lower down)

public class C {
  public static void main(String[] arg) {
    System.err.println(A.instance);
    System.err.println(A.instance.getInstance());
  }
}
 
interface A {
  public static A instance = new A() {
    public A getInstance() {
      return instance;
    }
  };
 
  public abstract A getInstance();
}

JamVM output:

mkoch@asterix ~> jamvm C
A$1@401ff580
A$1@401ff580

GIJ-3.4 output:
mkoch@asterix ~> gij-3.4 C
A$1@8093f68
Exception in thread "main" java.lang.IncompatibleClassChangeError: field
A$1.instance was not found.
   at _Jv_ResolvePoolEntry(java.lang.Class, int) (/usr/lib/libgcj.so.5.0.0)
   at A$1.getInstance() (Unknown Source)
   at C.main(java.lang.String[]) (Unknown Source)
mkoch@asterix ~> /home/mkoch/local/gcc-
gcc-3.4-debian  gcc-4.0         gcc-awt

GIJ-4.0 output:
mkoch@asterix ~> /home/mkoch/local/gcc-4.0/bin/gij-4.0 C
A$1@80b0f28
Exception in thread "main" java.lang.IncompatibleClassChangeError: field
A$1.instance was not found.
   at _Jv_Linker.resolve_pool_entry(java.lang.Class, int)
(/home/mkoch/local/gcc-4.0/lib/libgcj.so.6.0.0)
   at A$1.getInstance() (Unknown Source)
   at C.main(java.lang.String[]) (Unknown Source)

Kaffe output:
mkoch@asterix ~> kaffe C
A$1@83a1460
A$1@83a1460
mkoch@asterix ~>

-- 
           Summary: Interface containing anonymous class breaks gij
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: konqueror at gmx dot de
        ReportedBy: steph at tangency dot co dot uk
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18868


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug java/18868] Interface containing anonymous class breaks gij
  2004-12-07 13:20 [Bug java/18868] New: Interface containing anonymous class breaks gij steph at tangency dot co dot uk
@ 2004-12-07 13:24 ` konqueror at gmx dot de
  2004-12-07 13:55 ` konqueror at gmx dot de
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: konqueror at gmx dot de @ 2004-12-07 13:24 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From konqueror at gmx dot de  2004-12-07 13:24 -------
The bug only occurs when compiling the testcase with jikes (1.22) and not when 
compiling gcj (3.4.2 or 4.0.0).  

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |3.4.2 4.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18868


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug java/18868] Interface containing anonymous class breaks gij
  2004-12-07 13:20 [Bug java/18868] New: Interface containing anonymous class breaks gij steph at tangency dot co dot uk
  2004-12-07 13:24 ` [Bug java/18868] " konqueror at gmx dot de
@ 2004-12-07 13:55 ` konqueror at gmx dot de
  2004-12-07 13:58 ` aph at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: konqueror at gmx dot de @ 2004-12-07 13:55 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From konqueror at gmx dot de  2004-12-07 13:55 -------
Created an attachment (id=7699)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7699&action=view)
Testcase compile by jikes 1.22


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18868


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug java/18868] Interface containing anonymous class breaks gij
  2004-12-07 13:20 [Bug java/18868] New: Interface containing anonymous class breaks gij steph at tangency dot co dot uk
  2004-12-07 13:24 ` [Bug java/18868] " konqueror at gmx dot de
  2004-12-07 13:55 ` konqueror at gmx dot de
@ 2004-12-07 13:58 ` aph at gcc dot gnu dot org
  2004-12-07 19:58 ` [Bug libgcj/18868] " tromey at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: aph at gcc dot gnu dot org @ 2004-12-07 13:58 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|konqueror at gmx dot de     |unassigned at gcc dot gnu
                   |                            |dot org
             Status|UNCONFIRMED                 |NEW


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18868


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libgcj/18868] Interface containing anonymous class breaks gij
  2004-12-07 13:20 [Bug java/18868] New: Interface containing anonymous class breaks gij steph at tangency dot co dot uk
                   ` (2 preceding siblings ...)
  2004-12-07 13:58 ` aph at gcc dot gnu dot org
@ 2004-12-07 19:58 ` tromey at gcc dot gnu dot org
  2004-12-07 20:08 ` tromey at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at gcc dot gnu dot org @ 2004-12-07 19:58 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2004-12-07 19:58 -------
I compiled A.java with 'gcj -C A.java', downloaded C.class, and ran
"gij C" without problems.
I'm using a recent-ish cvs head.

If the problem is in the other .class files, please upload them both.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18868


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libgcj/18868] Interface containing anonymous class breaks gij
  2004-12-07 13:20 [Bug java/18868] New: Interface containing anonymous class breaks gij steph at tangency dot co dot uk
                   ` (3 preceding siblings ...)
  2004-12-07 19:58 ` [Bug libgcj/18868] " tromey at gcc dot gnu dot org
@ 2004-12-07 20:08 ` tromey at gcc dot gnu dot org
  2004-12-07 20:20 ` tromey at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at gcc dot gnu dot org @ 2004-12-07 20:08 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2004-12-07 20:08 -------
I was able to reproduce this by compiling A.java with jikes.

libgcj should find the field A$1.instance as inherited from
A, but it does not.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18868


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libgcj/18868] Interface containing anonymous class breaks gij
  2004-12-07 13:20 [Bug java/18868] New: Interface containing anonymous class breaks gij steph at tangency dot co dot uk
                   ` (4 preceding siblings ...)
  2004-12-07 20:08 ` tromey at gcc dot gnu dot org
@ 2004-12-07 20:20 ` tromey at gcc dot gnu dot org
  2005-01-05 23:19 ` tromey at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at gcc dot gnu dot org @ 2004-12-07 20:20 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2004-12-07 20:20 -------
The bug is that libgcj is not searching the superinterfaces
of A$1.  The fix is to use code similar to that in the method
case in _Jv_linker::resolve_pool_entry.  (This need only be
done for static fields)

It may be too late to fix this, unless this can be shown to
be a regression.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18868


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libgcj/18868] Interface containing anonymous class breaks gij
  2004-12-07 13:20 [Bug java/18868] New: Interface containing anonymous class breaks gij steph at tangency dot co dot uk
                   ` (5 preceding siblings ...)
  2004-12-07 20:20 ` tromey at gcc dot gnu dot org
@ 2005-01-05 23:19 ` tromey at gcc dot gnu dot org
  2005-01-10 19:21 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-01-05 23:19 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-01-05 23:19 -------
I'm testing a patch for this


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |tromey at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18868


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libgcj/18868] Interface containing anonymous class breaks gij
  2004-12-07 13:20 [Bug java/18868] New: Interface containing anonymous class breaks gij steph at tangency dot co dot uk
                   ` (6 preceding siblings ...)
  2005-01-05 23:19 ` tromey at gcc dot gnu dot org
@ 2005-01-10 19:21 ` cvs-commit at gcc dot gnu dot org
  2005-01-10 19:23 ` tromey at gcc dot gnu dot org
  2005-01-10 19:25 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-10 19:21 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-01-10 19:21 -------
Subject: Bug 18868

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tromey@gcc.gnu.org	2005-01-10 19:21:46

Modified files:
	libjava        : ChangeLog link.cc 
	libjava/include: jvm.h 

Log message:
	PR libgcj/18868:
	* include/jvm.h (_Jv_Linker::find_field): Declare.
	(_Jv_Linker::find_field_helper): Likewise.
	* link.cc (find_field_helper): New method.
	(find_field): Likewise.
	(resolve_pool_entry): Use it.  Throw NoSuchFieldError when field
	not found.
	(link_symbol_table): Use find_field.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.3279&r2=1.3280
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/link.cc.diff?cvsroot=gcc&r1=1.5&r2=1.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/include/jvm.h.diff?cvsroot=gcc&r1=1.71&r2=1.72



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18868


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libgcj/18868] Interface containing anonymous class breaks gij
  2004-12-07 13:20 [Bug java/18868] New: Interface containing anonymous class breaks gij steph at tangency dot co dot uk
                   ` (7 preceding siblings ...)
  2005-01-10 19:21 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-10 19:23 ` tromey at gcc dot gnu dot org
  2005-01-10 19:25 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-01-10 19:23 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-01-10 19:23 -------
I've checked in a fix for this.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18868


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libgcj/18868] Interface containing anonymous class breaks gij
  2004-12-07 13:20 [Bug java/18868] New: Interface containing anonymous class breaks gij steph at tangency dot co dot uk
                   ` (8 preceding siblings ...)
  2005-01-10 19:23 ` tromey at gcc dot gnu dot org
@ 2005-01-10 19:25 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-10 19:25 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18868


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-01-10 19:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-07 13:20 [Bug java/18868] New: Interface containing anonymous class breaks gij steph at tangency dot co dot uk
2004-12-07 13:24 ` [Bug java/18868] " konqueror at gmx dot de
2004-12-07 13:55 ` konqueror at gmx dot de
2004-12-07 13:58 ` aph at gcc dot gnu dot org
2004-12-07 19:58 ` [Bug libgcj/18868] " tromey at gcc dot gnu dot org
2004-12-07 20:08 ` tromey at gcc dot gnu dot org
2004-12-07 20:20 ` tromey at gcc dot gnu dot org
2005-01-05 23:19 ` tromey at gcc dot gnu dot org
2005-01-10 19:21 ` cvs-commit at gcc dot gnu dot org
2005-01-10 19:23 ` tromey at gcc dot gnu dot org
2005-01-10 19:25 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).