Potential compiler bug

Stefan Marr java at stefan-marr.de
Mon Nov 3 17:15:25 UTC 2014

Dear all:

In an experiment I did to assess the impact of using a proper object layout on TruffleSOM, I am running into issues with the latest Graal version.

As far as I can tell, stores to an array are not actually done. Simple writes get lost.
In the experiment, I replaced my object layout implementation with just stores into an Object array.

To reproduce the issue, the following branch and example can be used:

git clone -b mt-vs-pe/without-object-layout --recursive https://github.com/smarr/TruffleSOM

../graal/mxtool/mx —vm server vm -G:-TraceTruffleInlining -G:-TraceTruffleCompilation -G:+TruffleSplitting -G:+TruffleCompilationExceptionsAreFatal -esa -ea -Xbootclasspath/a:build/classes:libs/truffle.jar som.vm.Universe -cp Smalltalk:Examples/Benchmarks/DeltaBlue Examples/Benchmarks/BenchmarkHarness.som Bounce 100 0 200

The benchmark will abort with a wrong result. The culprit seems to be a compilation of the #next method in the Random class, which looks like this:

   next = (
       "seed print. ' ' print. (((seed * 1309) + 13849) & 65535) print. ' ' print."
       seed := ((seed * 1309) + 13849) & 65535.
       "seed println."

The stuff in quotes are comments, and the output indicates that reading works nicely, but writing can just fail, i.e., the method returns the old value instead of the new one.

I already had that branch working some weeks ago, so, I assume this is something that creeped into the codebase recently.

Best regards

Stefan Marr
INRIA Lille - Nord Europe

More information about the graal-dev mailing list