-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Dotty backend fails to emit code in CSE'd if predicate #1442
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
Labels
Comments
For future reference. I've introduced an undocumented environment variable printBCODE=sum dotc bfail.scala
Bytecode for method sum
L0
LINENUMBER 2 L0
L1
LINENUMBER 4 L1
ACONST_NULL
CHECKCAST scala/math/Numeric$
L2
ASTORE 2
L3
LINENUMBER 5 L3
GETSTATIC scala/math/Numeric$.MODULE$ : Lscala/math/Numeric$;
ASTORE 2
ALOAD 1
ALOAD 2
GETSTATIC scala/math/Numeric$IntIsIntegral$.MODULE$ : Lscala/math/Numeric$IntIsIntegral$;
IF_ACMPEQ L4
GOTO L5
L4
ICONST_1
GOTO L6
L5
ICONST_0
L6
IFNE L7
GOTO L8
L8
LINENUMBER 6 L8
ALOAD 1
ALOAD 2
GETSTATIC scala/math/Numeric$BigIntIsIntegral$.MODULE$ : Lscala/math/Numeric$BigIntIsIntegral$;
IF_ACMPEQ L7
GOTO L9
L9
LINENUMBER 7 L9
ALOAD 1
ALOAD 2
GETSTATIC scala/math/Numeric$ShortIsIntegral$.MODULE$ : Lscala/math/Numeric$ShortIsIntegral$;
IF_ACMPEQ L7
GOTO L10
L10
LINENUMBER 8 L10
ALOAD 1
ALOAD 2
GETSTATIC scala/math/Numeric$ByteIsIntegral$.MODULE$ : Lscala/math/Numeric$ByteIsIntegral$;
IF_ACMPEQ L7
GOTO L11
L11
LINENUMBER 9 L11
ALOAD 1
ALOAD 2
GETSTATIC scala/math/Numeric$CharIsIntegral$.MODULE$ : Lscala/math/Numeric$CharIsIntegral$;
IF_ACMPEQ L7
GOTO L12
L12
LINENUMBER 10 L12
ALOAD 1
ALOAD 2
GETSTATIC scala/math/Numeric$LongIsIntegral$.MODULE$ : Lscala/math/Numeric$LongIsIntegral$;
IF_ACMPEQ L7
GOTO L13
L13
LINENUMBER 11 L13
ALOAD 1
ALOAD 2
// HERE IS THE BUG.
GETSTATIC scala/math/Numeric$FloatAsIfIntegral$.MODULE$ : Lscala/math/Numeric$FloatAsIfIntegral$;
IF_ACMPEQ L7
GOTO L14
L14
LINENUMBER 12 L14
ALOAD 1
ALOAD 2
GETSTATIC scala/math/Numeric$BigDecimalIsFractional$.MODULE$ : Lscala/math/Numeric$BigDecimalIsFractional$;
IF_ACMPEQ L7
GOTO L15
L15
LINENUMBER 13 L15
ALOAD 1
ALOAD 2
GETSTATIC scala/math/Numeric$DoubleAsIfIntegral$.MODULE$ : Lscala/math/Numeric$DoubleAsIfIntegral$;
IF_ACMPEQ L7
GOTO L16
L7
LINENUMBER 14 L7
ACONST_NULL
POP
ACONST_NULL
GOTO L17
L16
LINENUMBER 15 L16
ACONST_NULL
POP
ACONST_NULL
L17
ARETURN
L18
LOCALVARIABLE cse Lscala/math/Numeric$; L2 L17 2
LOCALVARIABLE this LTest$; L1 L18 0
LOCALVARIABLE num Lscala/math/Numeric; L1 L18 1
MAXSTACK = 0
MAXLOCALS = 0 |
DarkDimius
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 9, 2016
DarkDimius
added a commit
that referenced
this issue
Aug 15, 2016
Fix #1442: add new phase, SelectStatic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code snippet:
REPL fails with:
The Linker (in the branch
cse-rebase
, that implements Common Subexpression Elimination) fails with a more concise error:It seems to me that this code should compile. Therefore, I consider this a bug. The original source code is located in the
Numeric
class of the Scala standard library.The text was updated successfully, but these errors were encountered: