Bug 27643

Summary: ICE in java_mark_cni_decl_local compiling bytecode->native
Product: gcc Reporter: Bryce McKinlay <bryce>
Component: javaAssignee: Tom Tromey <tromey>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs, java-prs, tromey
Priority: P3    
Version: unknown   
Target Milestone: 4.3.0   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2006-05-24 17:23:37

Description Bryce McKinlay 2006-05-17 16:13:14 UTC
The following test case crashes:

$ gcj -C PipeImpl.java
$ gcj -c *.class -o t.o
PipeImpl.java:0: internal compiler error: in java_mark_cni_decl_local, at java/decl.c:2182

class PipeImpl
{
  public PipeImpl ()
  {
    VMPipe.init (this);
  }
}

final class VMPipe
{
  static native void init(PipeImpl self);
}
Comment 1 Ranjit Mathew 2006-05-18 07:36:58 UTC
I'm not able to reproduce this problem with the current mainline (2006-05-18).
Comment 2 Tom Tromey 2006-05-18 16:01:56 UTC
I was able to reproduce yesterday; but I'm updating and rebuilding
just to be sure.

The bug is dependent on the order in which the .class files are read.
Comment 3 Ranjit Mathew 2006-05-22 08:56:08 UTC
OK, I was able to reproduce this. My problem was that I had a "--disable-checking"
build. If the order of the class files is "PipeImpl.class VMPipe.class", I get
an error; if the order is the other way around, I don't.
Comment 4 Tom Tromey 2006-05-24 17:23:37 UTC
I have a patch I'm testing.
Comment 5 Tom Tromey 2007-01-25 23:59:33 UTC
Works in svn trunk.
Comment 6 Andrew Haley 2007-12-18 14:06:38 UTC
Subject: Bug 27643

Author: aph
Date: Tue Dec 18 14:06:15 2007
New Revision: 131036

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131036
Log:
2007-12-18  Andrew Haley  <aph@redhat.com>

        PR java/27643
        * jcf-parse.c (java_parse_file): Remove call to
        java_mark_class_local.
        (parse_class_file): Reinstate call to java_mark_class_local here.
        * decl.c (java_mark_cni_decl_local): If the ASSEMBLER_NAME is
        already set, call java_mangle_decl() and make_decl_rtl() to
        rewrite its name as a hidden alias.


Modified:
    trunk/gcc/java/ChangeLog
    trunk/gcc/java/decl.c
    trunk/gcc/java/jcf-parse.c