Skip to content
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

Fix and test LLVM IR for issue #36422 #36435

Merged
merged 1 commit into from
Jun 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2352,7 +2352,7 @@ static Value *emit_bits_compare(jl_codectx_t &ctx, jl_cgval_t arg1, jl_cgval_t a
nroots++;
if ((gc_uses[nroots] = get_gc_root_for(arg2)))
nroots++;
OperandBundleDef OpBundle("jl_roots", gc_uses);
OperandBundleDef OpBundle("jl_roots", makeArrayRef(gc_uses, nroots));
Value *answer = ctx.builder.CreateCall(prepare_call(memcmp_func), {
ctx.builder.CreateBitCast(varg1, T_pint8),
ctx.builder.CreateBitCast(varg2, T_pint8),
Expand Down
5 changes: 5 additions & 0 deletions test/compiler/codegen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -451,3 +451,8 @@ end
a = [1]; b = [2]
@test ifelsetuple(5, 3, a, b) == ([1], [1], [1], [2], [2])
end

@testset "#36422" begin
str_36422 = "using InteractiveUtils; code_llvm(Base.ht_keyindex, (Dict{NTuple{65,Int64},Nothing}, NTuple{65,Int64}))"
@test success(`$(Base.julia_cmd()) --startup-file=no -e $str_36422`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this in a new process? So it doesn't segfault the worker if it fails?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have many tests that will just segfault the worker if they "fail", so I think it would be fine without the external process, but I don't care much either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's why. I saw this method used above, so I thought it would be desired. If I should change it I certainly can.

end