New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scala optimizer generates incorrect code (2.11 regression) #9403
Comments
Imported From: https://issues.scala-lang.org/browse/SI-9403?orig=1 |
@som-snytt said: |
Jeff Olson (jdolson) said: This is a show-stopper for me. I can't upgrade my project to Scala 2.11 because of it. |
@lrytz said: |
Jeff Olson (jdolson) said: |
@lrytz said: |
Jeff Olson (jdolson) said: |
@retronym said (edited on Jul 27, 2015 4:15:17 AM UTC): It is responsible for reading bytecode of previously compiled classes and translating them into an intermediate representation called So disabling |
Jeff Olson (jdolson) said: |
I found an instance where the scala optimizer is generating incorrect bytecode which results in broken integer arithmetic (given a 39 where it should give a -5000). It happens for all versions of scala
2.11.x
but worked correctly in2.10.x
. It only happens with-optimize
.I've put the complete code necessary to reproduce on github. But I'll paste the important bits here. The following two files must in different projects (e.g. a main and a test project) in order to trigger the bug:
Looking at the bytecode the problem happens when the
bar
method is inlined. Scala 2.10 generates thiswhereas Scala 2.11 is generating this:
The only meaningful difference is that
bipush -2
is getting replaced withsipush 254
, which is clearly incorrect.The text was updated successfully, but these errors were encountered: