java/2658: Inner class with initializer block emits bad code
Thu Apr 26 13:36:00 GMT 2001

>Number:         2658
>Category:       java
>Synopsis:       Inner class with initializer block emits bad code
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 26 13:36:01 PDT 2001
>Release:        HEAD and gcc 3.0 branch 26 Apr 2001
i686-pc-linux-gnu, and i686-pc-cygwin

% gcj -o Toy.x --main=Toy; ./Toy.x

Exception in thread "main" java.lang.NullPointerException 
   at 0x4016802c: _Jv_ThrowSignal (/usr/local/pkgs/gcc/lib/ 
   at 0x4016806d: _Jv_ThrowSignal (/usr/local/pkgs/gcc/lib/ 
   at 0x08048a0b: Toy__U24_Inner.finit__U24_() (/home/tony/w/Swarmcast/build/native/bugs/ 
   at 0x08048a3f: Toy__U24_Inner.Toy__U24_Inner(Toy) (/home/tony/w/Swarmcast/build/native/bugs/ 
   at 0x08048ab5: Toy.Toy() (/home/tony/w/Swarmcast/build/native/bugs/ 
   at 0x08048b34: Toy.main(java.lang.String[]) (/home/tony/w/Swarmcast/build/native/bugs/ 
   at 0x4017ee0b: (/usr/local/pkgs/gcc/lib/ 
   at 0x4018a2ab: java.lang.Thread.run_(java.lang.Object) (/usr/local/pkgs/gcc/lib/ 
   at 0x4029c385: _Jv_ThreadSetPriority(_Jv_Thread_t, int) (/usr/local/pkgs/gcc/lib/ 
   at 0x4044761c: GC_start_routine (/usr/local/pkgs/gcc/lib/ 
   at 0x4046060e: pthread_detach (/lib/ 
   at 0x4055edaa: __clone (/lib/ 


public class Toy {
	protected int outer_var = 0;
	class Inner {
		private int inner_var = outer_var;
		Inner()	{ };
	public Toy() {
		Inner inner = new Inner();

	public static void main(String args[]) {
		Toy instance = new Toy();

See descr.
Probably related to changing the code modified by 
the patch associated with PR/1315

More information about the Gcc-bugs mailing list