From 7622bae03739b5bb82ac02428d95e2b93b4715ab Mon Sep 17 00:00:00 2001 From: Eric Davies Date: Mon, 29 Jun 2020 14:36:32 -0500 Subject: [PATCH] Fix and test LLVM IR for issue #36422 (#36435) --- src/codegen.cpp | 2 +- test/compiler/codegen.jl | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/codegen.cpp b/src/codegen.cpp index fcb7ef2e23934..49b47aef82f89 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -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), diff --git a/test/compiler/codegen.jl b/test/compiler/codegen.jl index f90ed2a96d815..c2e157bbfe3f5 100644 --- a/test/compiler/codegen.jl +++ b/test/compiler/codegen.jl @@ -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`) +end