http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21855
--- Comment #24 from Tom Tromey <tromey at gcc dot gnu.org> 2012-01-10 17:21:02 UTC --- I found my code and it turns out I never finished it. (I did write a java-specific devirtualization pass.) Here is an introductory comment that explains my plans: /* This pass implements a few simple gcj-specific optimizations related to handling of invariants. In Java, certain fields of some objects are known to be invariant after the object has been created. For instance, the vtable pointer of an object cannot change; neither can the length of an array. Also, this pass knows that 'new Type[n]' sets the length of an array to 'n'. Ideally GCC would recognize these cases and optimize for us. However, currently there is no way to express these properties to the optimizers. */