This is a hotspot bug for bug db 12556084
The Oracle XML parser has a particular loop which when optimized by c2 produces incorrect results. There is a small test case attached; when run on a nahalem-class machine with Linux, the test case will fail about 20% of the time using JDK 6u28 (and earlier releases). I have been unable to get it to fail on Solaris or faster Intel machines.
There have been discussions that the root cause of this bug is 7044738, but that bug is marked as fixed delivered in 6u28 build 03, for which the attached test case is failing. So rather than re-opening that bug, I am filing this new bug.