public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/19921] New: wrong argument count for invokeInterface with new multidimensional array
@ 2005-02-12 13:51 kon at iki dot fi
  2005-02-12 13:53 ` [Bug java/19921] " kon at iki dot fi
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: kon at iki dot fi @ 2005-02-12 13:51 UTC (permalink / raw)
  To: java-prs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4027 bytes --]

A GCC checked out on 2005-02-12 compiles the following Java
source to invalid bytecode.  This is a variation of code that
occurs in gnu.classpath.tools.gjdoc.Main.startDoclet.

interface I {
    void f(Object x);
}

class C {
    static void g(I i) {
        i.f(new Object[1][1]);
    }
}

$ gcj -C -v array.java
Using built-in specs.
Target: i386-pc-linux-gnu
Configured with: /home/kalle/src/FOREIGN-CVS/gcc/configure --prefix=/home/kalle
--exec-prefix=/home/kalle/i386-pc-linux-gnu --host=i386-pc-linux-gnu
--build=i386-pc-linux-gnu --with-x-toolkit=gtk
Thread model: posix
gcc version 4.0.0 20050212 (experimental)

/home/kalle/stow/gcc/i386-pc-linux-gnu/bin/../libexec/gcc/i386-pc-linux-gnu/4.0.0/jc1 array.java -quiet -dumpbase array.java -auxbase-strip NONE -g1 -version
-fsyntax-only -femit-class-files -o /dev/null
GNU Java version 4.0.0 20050212 (experimental) (i386-pc-linux-gnu)
	compiled by GNU C version 4.0.0 20050129 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Class path starts here:
    ./
   
/home/kalle/stow/gcc/i386-pc-linux-gnu/bin/../lib/gcc/../../../share/java/libgcj-4.0.0.jar/ (system) (zip)
$ ls -l
yhteensÃEUR 12
-rw-rw-r--  1 kalle kalle 113 2005-02-12 09:45 array.java
-rw-rw-r--  1 kalle kalle 303 2005-02-12 09:45 C.class
-rw-rw-r--  1 kalle kalle 123 2005-02-12 09:45 I.class
$ gij C
Exception in thread "main" java.lang.VerifyError: verification failed at PC 7
in C:g((LI;)V): wrong argument count for invokeinterface
   at _Jv_BytecodeVerifier.verify_fail(byte, int)
(/home/kalle/stow/gcc/i386-pc-linux-gnu/lib/libgcj.so.6.0.0)
   at _Jv_BytecodeVerifier.verify_instructions_0()
(/home/kalle/stow/gcc/i386-pc-linux-gnu/lib/libgcj.so.6.0.0)
   at _Jv_VerifyMethod(_Jv_InterpMethod)
(/home/kalle/stow/gcc/i386-pc-linux-gnu/lib/libgcj.so.6.0.0)
   at _Jv_InterpreterEngine.do_verify(java.lang.Class)
(/home/kalle/stow/gcc/i386-pc-linux-gnu/lib/libgcj.so.6.0.0)
   at _Jv_Linker.verify_class(java.lang.Class)
(/home/kalle/stow/gcc/i386-pc-linux-gnu/lib/libgcj.so.6.0.0)
   at _Jv_Linker.wait_for_state(java.lang.Class, int)
(/home/kalle/stow/gcc/i386-pc-linux-gnu/lib/libgcj.so.6.0.0)
   at java.lang.VMClassLoader.resolveClass(java.lang.Class)
(/home/kalle/stow/gcc/i386-pc-linux-gnu/lib/libgcj.so.6.0.0)
   at java.lang.Class.initializeClass()
(/home/kalle/stow/gcc/i386-pc-linux-gnu/lib/libgcj.so.6.0.0)
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)
(/home/kalle/stow/gcc/i386-pc-linux-gnu/lib/libgcj.so.6.0.0)
   at java.lang.Class.forName(java.lang.String)
(/home/kalle/stow/gcc/i386-pc-linux-gnu/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.run()
(/home/kalle/stow/gcc/i386-pc-linux-gnu/lib/libgcj.so.6.0.0)
   at _Jv_ThreadRun(java.lang.Thread)
(/home/kalle/stow/gcc/i386-pc-linux-gnu/lib/libgcj.so.6.0.0)
   at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean)
(/home/kalle/stow/gcc/i386-pc-linux-gnu/lib/libgcj.so.6.0.0)
   at main (/home/kalle/stow/gcc/i386-pc-linux-gnu/lib/libgij.so.6.0.0)
   at __libc_start_main (/lib/libc-2.3.2.so)
   at _start
(/home/kalle/svn/y2004/lentoasema/trunk/bugit/GCC/x/../sysdeps/i386/elf/start.S:105)
$ jcf-dump -c C.class | grep invokeinterface
  7: invokeinterface <InterfaceMethod I.f (java.lang.Object)void> nargs:3
$ 

If I add more dimensions to the array, then gcj generates even more
extra arguments.

-- 
           Summary: wrong argument count for invokeInterface with new
                    multidimensional array
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kon at iki dot fi
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org
 GCC build triplet: i386-pc-linux-gnu
  GCC host triplet: i386-pc-linux-gnu
GCC target triplet: i386-pc-linux-gnu


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


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

* [Bug java/19921] wrong argument count for invokeInterface with new multidimensional array
  2005-02-12 13:51 [Bug java/19921] New: wrong argument count for invokeInterface with new multidimensional array kon at iki dot fi
@ 2005-02-12 13:53 ` kon at iki dot fi
  2005-02-14 14:58 ` tromey at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: kon at iki dot fi @ 2005-02-12 13:53 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code


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


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

* [Bug java/19921] wrong argument count for invokeInterface with new multidimensional array
  2005-02-12 13:51 [Bug java/19921] New: wrong argument count for invokeInterface with new multidimensional array kon at iki dot fi
  2005-02-12 13:53 ` [Bug java/19921] " kon at iki dot fi
@ 2005-02-14 14:58 ` tromey at gcc dot gnu dot org
  2005-02-15  0:48 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-02-14 14:58 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-02-13 00:20 -------
I'm testing a patch.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |tromey at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-02-13 00:20:03
               date|                            |


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


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

* [Bug java/19921] wrong argument count for invokeInterface with new multidimensional array
  2005-02-12 13:51 [Bug java/19921] New: wrong argument count for invokeInterface with new multidimensional array kon at iki dot fi
  2005-02-12 13:53 ` [Bug java/19921] " kon at iki dot fi
  2005-02-14 14:58 ` tromey at gcc dot gnu dot org
@ 2005-02-15  0:48 ` cvs-commit at gcc dot gnu dot org
  2005-02-16  4:10 ` tromey at gcc dot gnu dot org
  2005-02-17 16:55 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-02-15  0:48 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-02-14 20:04 -------
Subject: Bug 19921

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tromey@gcc.gnu.org	2005-02-14 20:04:36

Modified files:
	libjava        : ChangeLog 
	gcc/java       : ChangeLog jcf-write.c 
Added files:
	libjava/testsuite/libjava.lang: PR19929.java PR19929.out 

Log message:
	gcc/java:
	PR java/19921:
	* jcf-write.c (generate_bytecode_insns) <CALL_EXPR>: Note the
	stack effect of multianewarray.
	
	libjava:
	For PR java/19929:
	* testsuite/libjava.lang/PR19929.out: New file.
	* testsuite/libjava.lang/PR19929.java: New file.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.3320&r2=1.3321
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.lang/PR19929.java.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.lang/PR19929.out.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1551&r2=1.1552
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/jcf-write.c.diff?cvsroot=gcc&r1=1.161&r2=1.162



-- 


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


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

* [Bug java/19921] wrong argument count for invokeInterface with new multidimensional array
  2005-02-12 13:51 [Bug java/19921] New: wrong argument count for invokeInterface with new multidimensional array kon at iki dot fi
                   ` (2 preceding siblings ...)
  2005-02-15  0:48 ` cvs-commit at gcc dot gnu dot org
@ 2005-02-16  4:10 ` tromey at gcc dot gnu dot org
  2005-02-17 16:55 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-02-16  4:10 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-02-14 20:05 -------
I checked in a fix for this.


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


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


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

* [Bug java/19921] wrong argument count for invokeInterface with new multidimensional array
  2005-02-12 13:51 [Bug java/19921] New: wrong argument count for invokeInterface with new multidimensional array kon at iki dot fi
                   ` (3 preceding siblings ...)
  2005-02-16  4:10 ` tromey at gcc dot gnu dot org
@ 2005-02-17 16:55 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-17 16:55 UTC (permalink / raw)
  To: java-prs



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


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


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

end of thread, other threads:[~2005-02-16 19:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-12 13:51 [Bug java/19921] New: wrong argument count for invokeInterface with new multidimensional array kon at iki dot fi
2005-02-12 13:53 ` [Bug java/19921] " kon at iki dot fi
2005-02-14 14:58 ` tromey at gcc dot gnu dot org
2005-02-15  0:48 ` cvs-commit at gcc dot gnu dot org
2005-02-16  4:10 ` tromey at gcc dot gnu dot org
2005-02-17 16:55 ` 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).