This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

java/1424: Static inializers compiled incorrectly



>Number:         1424
>Category:       java
>Synopsis:       Static inializers compiled incorrectly
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    apbianco
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:19:43 PST 2000
>Closed-Date:    Tue Sep 21 09:02:56 PDT 1999
>Last-Modified:  Tue Sep 21 09:02:56 PDT 1999
>Originator:     Geoff Berry
>Release:        egcs_latest_snapshot 1999-09-16
>Organization:
>Environment:
Linux 2.2.10
glibc 2.0.7
>Description:
Static initializers are not compiled correctly with gcj -C
(and I suspect the same is true for native compilation).
A <clinit> method is produced, but it simply returns.
>How-To-Repeat:
Compile the following class with gcj -C:

class test {
  static {
    System.out.println ("Running static initializer.");
  }
}

Run jcf-dump -c on the resulting class file.
>Fix:
Patch submitted.
>Release-Note:

>Audit-Trail:

Formerly PR gcj/46

State-Changed-From-To: open->feedback
State-Changed-By: apbianco
State-Changed-When: Thu Sep 16 15:44:30 1999
State-Changed-Why:
    This patch helps. I haven't tried to recompile the runtime
    with it, though.
    
    Thu Sep 16 15:42:39 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
    
    	* parse.y (java_method_add_stmt): Test on null fndecl (which
     	defaults to using current_static_block through GET_CURRENT_BLOCK)
     	removed.
    Index: parse.y
    ===================================================================
    RCS file: /cvs/egcs/egcs/gcc/java/parse.y,v
    retrieving revision 1.109
    diff -u -p -r1.109 parse.y
    --- parse.y     1999/09/12 03:20:31     1.109
    +++ parse.y     1999/09/16 22:40:07
    @@ -5841,8 +5841,6 @@ tree
     java_method_add_stmt (fndecl, expr)
          tree fndecl, expr;
     {
    -  if (!fndecl)
    -    return NULL;
       return add_stmt_to_block (GET_CURRENT_BLOCK (fndecl), NULL_TREE, expr);
     }
     
    
    
State-Changed-From-To: feedback->closed
State-Changed-By: apbianco
State-Changed-When: Tue Sep 21 09:02:56 1999
State-Changed-Why:
    A patch has been checked in. See 
    http://egcs.cygnus.com/ml/gcc-patches/1999-09/msg00951.html
    
    Note: this patch is different from the one originally
    proposed.
>Unformatted:



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]