The source of the problem is https://github.com/JuliaData/DataFrames.jl/issues/1730.
Here is a MWE:
julia> using Statistics
julia> function get_stats(col::AbstractVector, stats::AbstractVector{Symbol})
if :q25 in stats || :median in stats || :q75 in stats
try quantile(col, [.25, .5, .75]) catch end
end
if :min in stats || :max in stats
try extrema(col) catch end
end
if :mean in stats || :std in stats
m = try mean(col) catch end
end
if :std in stats
try std(col, mean=m) catch end
end
end
get_stats (generic function with 1 method)
julia> get_stats(Int[], [:min])
Unreachable reached at 000000001F2D2ED9
The problem seems with the use of m in std. If we write try std(col) catch end not to use m the problem stops to be present.
Strangely removing other ifs also kills the problem. Note that the part of the code that causes the problem is not even executed as we pass [:min] as the second kewyord argument.
@JeffBezanson I know that there are many "Unreachable reached" issues, but I could not find one that is exactly the same (but maybe it is a duplicate).
If m is defined before the first if or we move if :std in stats inside the earlier if the problem is fixed so it seems that the compiler has some problem with deciding what m actually is.
Crashes in julia 0.7. Works in julia 0.6.
Any chance this happened to be fixed by https://github.com/JuliaLang/julia/pull/31129 today?
Reduced to:
function a()
try catch end
if try b catch end
c = try 0 catch end
end
c
end
a()
Any chance this happened to be fixed by #31129 today?
Still crashes on freshly-built master, so no.
duplicate of https://github.com/JuliaLang/julia/issues/29152. We encounter %14 = Ï’ (%12::Union{Nothing, Int64}), and see that this must be dead-code (since %12 was assigned from #undef), so we skip generating the code for %14

I can't reproduce on the latest master, should this be closed?
On 1.4.0 (2020-03-21) this seems to be fixed.
Most helpful comment
Reduced to:
Still crashes on freshly-built
master, so no.