diff --git a/src/llvm-late-gc-lowering.cpp b/src/llvm-late-gc-lowering.cpp index a48fd1a96eb8fc..642c828280d50f 100644 --- a/src/llvm-late-gc-lowering.cpp +++ b/src/llvm-late-gc-lowering.cpp @@ -729,7 +729,7 @@ void LateLowerGCFrame::NoteUse(State &S, BBState &BBS, Value *V, BitVector &Uses void LateLowerGCFrame::NoteOperandUses(State &S, BBState &BBS, User &UI, BitVector &Uses) { for (Use &U : UI.operands()) { Value *V = U; - if (!isSpecialPtr(V->getType())) + if (!isSpecialPtr(V->getType()) && !isSpecialPtrVec(V->getType())) continue; NoteUse(S, BBS, V, Uses); } diff --git a/test/core.jl b/test/core.jl index f9a08f1a990bfc..d843c2dbe1e902 100644 --- a/test/core.jl +++ b/test/core.jl @@ -6675,3 +6675,23 @@ c28399 = 42 @test g28399(0)() == 42 @test g28399(1)() == 42 @test_throws UndefVarError(:__undef_28399__) f28399() + +# issue #28445 +mutable struct foo28445 + x::Int +end + +@noinline make_foo28445() = (foo28445(1), foo28445(rand(1:10)), foo28445(rand(1:10))) +@noinline function use_tuple28445(c) + @test isa(c[2], foo28445) + @test isa(c[3], foo28445) +end + +function repackage28445() + (_, a, b) = make_foo28445() + GC.gc() + c = (foo28445(1), foo28445(2), a, b) + use_tuple28445(c) + true +end +@test repackage28445() diff --git a/test/llvmpasses/gcroots.ll b/test/llvmpasses/gcroots.ll index 25d75a8a7a0d16..958a735b8efcab 100644 --- a/test/llvmpasses/gcroots.ll +++ b/test/llvmpasses/gcroots.ll @@ -401,6 +401,19 @@ top: ret i8 %val } +define %jl_value_t addrspace(10)* @vecstoreload(<2 x %jl_value_t addrspace(10)*> *%arg) { +; CHECK-LABEL: @vecstoreload +; CHECK: %gcframe = alloca %jl_value_t addrspace(10)*, i32 4 +top: + %ptls = call %jl_value_t*** @julia.ptls_states() + %loaded = load <2 x %jl_value_t addrspace(10)*>, <2 x %jl_value_t addrspace(10)*> *%arg + call void @jl_safepoint() + %obj = call %jl_value_t addrspace(10) *@alloc() + %casted = bitcast %jl_value_t addrspace(10)* %obj to <2 x %jl_value_t addrspace(10)*> addrspace(10)* + store <2 x %jl_value_t addrspace(10)*> %loaded, <2 x %jl_value_t addrspace(10)*> addrspace(10)* %casted + ret %jl_value_t addrspace(10)* %obj +} + !0 = !{!"jtbaa"} !1 = !{!"jtbaa_const", !0, i64 0} !2 = !{!1, !1, i64 0, i64 1}