This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcj bug (with -C ?)


Tom Tromey wrote:

>Compile this class with `gcj -C':
>
>    public class t {
>      public static int x;
>
>      static {
>	      x = 72;
>      }
>
>      public static void main (String[] args)
>      {
>	System.out.println (x);
>      }
>    }
>
>Now run `jcf-dump -c' on the output.
>Note that there is no <clinit> method.
>I think this must be a regression.
>

maybe_yank_clinit()?

@@ -7860,7 +7865,7 @@
     bbody = BLOCK_EXPR_BODY (bbody);
   else
     return 0;
-  if (bbody && ! flag_emit_class_files && bbody != empty_stmt_node)
+  if (bbody && bbody != empty_stmt_node)
     return 0;
  
   type = DECL_CONTEXT (mdecl);


This patch seems to fix it, though the comment above it suggests that it 
isn't correct. I don't know why:

  /* If the body isn't empty, then we keep <clinit>. Note that if
     we're emitting classfiles, this isn't enough not to rule it
     out. */

regards

Bryce.



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