Skip to content

Commit 372e61d

Browse files
committed
effects: fix effects of atomic pointer operations
As discussed with Jameson earlier, the effects of atomic pointer operations are not precisely defined. This commit includes the minimal changes necessary to fix #57780, but a more extensive audit is planned for later. - closes #57780
1 parent 8efd4f4 commit 372e61d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Compiler/src/tfuncs.jl

+5
Original file line numberDiff line numberDiff line change
@@ -2891,7 +2891,12 @@ end
28912891
# whether `f` is pure for inference
28922892
function is_pure_intrinsic_infer(f::IntrinsicFunction)
28932893
return !(f === Intrinsics.pointerref || # this one is volatile
2894+
f === Intrinsics.atomic_pointerref || # this one is volatile
28942895
f === Intrinsics.pointerset || # this one is never effect-free
2896+
f === Intrinsics.atomic_pointerset || # this one is never effect-free
2897+
f === Intrinsics.atomic_pointerswap || # this one is never effect-free
2898+
f === Intrinsics.atomic_pointermodify || # this one is never effect-free
2899+
f === Intrinsics.atomic_pointerreplace || # this one is never effect-free
28952900
f === Intrinsics.llvmcall || # this one is never effect-free
28962901
f === Intrinsics.sqrt_llvm_fast || # this one may differ at runtime (by a few ulps)
28972902
f === Intrinsics.have_fma || # this one depends on the runtime environment

stdlib/REPL/test/replcompletions.jl

+6
Original file line numberDiff line numberDiff line change
@@ -2484,3 +2484,9 @@ let (c, r, res) = test_complete_context("global xxx::Number = Base.", Main)
24842484
@test res
24852485
@test "pi" c
24862486
end
2487+
2488+
# JuliaLang/julia#57780
2489+
const issue57780 = ["a", "b", "c"]
2490+
const issue57780_orig = copy(issue57780)
2491+
test_complete_context("empty!(issue57780).", Main)
2492+
@test issue57780 == issue57780_orig

0 commit comments

Comments
 (0)