-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Union split can cause assertion in debug mode #50964
Comments
Was this in the RR I sent you? |
Same test case |
Did this regress? Or has it always been broken? |
I don't know, we don't usually run with assertions enabled. |
We do have one CI job that runs the Base test suite with Julia assertions and LLVM assertions enabled. It only runs on x86_64-linux-gnu. It does not have debug symbols, i.e. it's just |
Looks like it should be detecting this is dead code and skipping emission of this statement (the assertion is semi-correct at detecting, but not handling, this). Usually this gets handled by the julia> code_typed(foo, (Int,))
1-element Vector{Any}:
CodeInfo(
@ REPL[3]:1 within `foo`
┌ @ boot.jl:430 within `Const`
1 ─│ %1 = %new(Core.Const, x)::Core.Const
│ └
│ %2 = Main.bar::typeof(bar)
│ %3 = (isa)(%1, Core.Const)::Bool
└── goto #3 if not %3
2 ─ %5 = invoke %2(%1::Core.Const)::Any
└── goto #6
3 ─ %7 = (isa)(%1, DataType)::Bool
└── goto #5 if not %7
4 ─ %9 = π (%1, DataType) # failure occurs here, `x::Core.Const`
│ %10 = invoke %2(%9::DataType)::Any
└── goto #6
5 ─ %12 = Main.bar(%1)::Any
└── goto #6
6 ┄ %14 = φ (#2 => %5, #4 => %10, #5 => %12)::Any
└── return %14
) => Any |
So this regressed in #44512 but I guess it doesn't really matter? |
So we should enter this branch if (jl_is_concrete_type(v.typ) && !jl_is_kind(v.typ)) {
if (jl_is_concrete_type(typ) && !jl_is_kind(typ)) {
// type mismatch: changing from one leaftype to another
if (skip)
*skip = ConstantInt::get(getInt1Ty(ctx.builder.getContext()), 1);
else
CreateTrap(ctx.builder);
return jl_cgval_t();
}
} |
Yes, that is the expectation of that code. The tests for |
With assertions enabled:
Reported-by: @oscardssmith
The text was updated successfully, but these errors were encountered: