Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Miscompilation in 4.08 #8558
The following code, when compiled with 4.08, raises
The initial lambda is:
which becomes, after
then translated by
and finally by
The problem, as I understand it, is that
It is not immediately clear to me what a good fix is (mainly because I do
(I believe it is used also in bytecode without -g.)
I did not expect static exits arguments were assumed to be pure. In particular, static exits were already used to compile tuple-bindings, so the bug might have been present in another form before. I will investigate a bit.
Ah right. Shouldn't this be generalized to at least constants?
let f () = let a = 42 in let b = 43 in a + b
let f () = 42 + 43
Also, the simplification for
I agree, but simplify_exits still applies in that mode and would previously introduce Alias binding, which would be eliminated even in that mode. The simple fix you suggest could thus produce code slower than before. Slow is ok, but is even slower still ok?
referenced this issue
Mar 29, 2019
Unless you have experimental data showing a major speed difference, simpler is best.
This is a serious code generation bug that was introduced in 4.08. Let us fix it ASAP rather than having rhetorical arguments about optimizations.