The output -1 becomes a slash in the loop
This can be reliably reproduced (or not reproduced, depending on what you want) with openjdk version “1.8.0_222” (used in my analysis), OpenJDK 12.0.1 (according to Oleksandr Pyrohov) and OpenJDK 13 (according to Carlos Heuberger). I ran the code with -XX:+PrintCompilation enough times to get both behaviours and here are the differences. Buggy implementation (displays output): … Read more