You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there. I was trying to implement a B-Tree at this repository but the insMany function in the .sml file caused a compilation error with MLton:
MLton 20210117 raised: Fail: SplitTypes.TypeInfo.coerce: Strange coercion: () coerced to word32 in val x_0: (word32) vector = prim Vector_vector[word32] (unit_0) in L_0 in insMany_0
This error occurred on two machines: a Raspberry Pi 5 and a Mac M2 (with the latest commit tested on the Raspberry Pi, and the 2021 version from the error message tested on the Mac).
I don't have an X86 machine with me to test if this is exclusively an error with MLton's ARM output unfortunately.
The error isn't raised when the insMany function is removed from the sole .sml file in the repository so I tried replacing it with a mutable while loop, but the while-loop version caused the error to be raised again.
The text was updated successfully, but these errors were encountered:
Confirmed, with both MLton 20210117 and current sources.
The bug is actually with the useless pass, just that the miscompilation doesn't trigger another ICE until the splitTypes2 pass. This can be observed by compiling with -type-check true, which runs the SSA type checker after every optimization pass, often discovering miscompilations that manifest as ill-typed IR programs:
useless starting
save bench.useless.pre.ssa starting
save bench.useless.pre.ssa finished in 0.01 + 0.00 (0% GC)
save bench.useless.post.ssa starting
save bench.useless.post.ssa finished in 0.00 + 0.00 (0% GC)
useless:typeCheck starting
useless:typeCheck raised: Fail: TypeError (SSA): Ssa.TypeCheck.primApp (Vector_vector(word32) (unit)) in val x_509: (word32) vector = prim Vector_vector[word32] (unit_0) in L_318 in insMany_0
useless:typeCheck raised in 0.00 + 0.00 (0% GC)
useless raised in 0.02 + 0.00 (0% GC)
Seems to be related to the use of a singleton vector expression, which becomes the Vector_vector primitive.
Hi there. I was trying to implement a B-Tree at this repository but the insMany function in the .sml file caused a compilation error with MLton:
MLton 20210117 raised: Fail: SplitTypes.TypeInfo.coerce: Strange coercion: () coerced to word32 in val x_0: (word32) vector = prim Vector_vector[word32] (unit_0) in L_0 in insMany_0
This error occurred on two machines: a Raspberry Pi 5 and a Mac M2 (with the latest commit tested on the Raspberry Pi, and the 2021 version from the error message tested on the Mac).
I don't have an X86 machine with me to test if this is exclusively an error with MLton's ARM output unfortunately.
The error isn't raised when the insMany function is removed from the sole .sml file in the repository so I tried replacing it with a mutable while loop, but the while-loop version caused the error to be raised again.
The text was updated successfully, but these errors were encountered: