gcj bug (with -C ?)

Bryce McKinlay bryce@waitaki.otago.ac.nz
Sun Dec 9 18:30:00 GMT 2001


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.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /