This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/21855] array bounds checking elimination
- From: "tromey at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 10 Jan 2012 17:21:02 +0000
- Subject: [Bug java/21855] array bounds checking elimination
- Auto-submitted: auto-generated
- References: <bug-21855-4@http.gcc.gnu.org/bugzilla/>
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.
*/