Skip to content

Commit ce0aae0

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 e746505 commit ce0aae0

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Compiler/src/tfuncs.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2939,7 +2939,12 @@ end
29392939
# whether `f` is pure for inference
29402940
function is_pure_intrinsic_infer(f::IntrinsicFunction)
29412941
return !(f === Intrinsics.pointerref || # this one is volatile
2942+
f === Intrinsics.atomic_pointerref || # this one is volatile
29422943
f === Intrinsics.pointerset || # this one is never effect-free
2944+
f === Intrinsics.atomic_pointerset || # this one is never effect-free
2945+
f === Intrinsics.atomic_pointerswap || # this one is never effect-free
2946+
f === Intrinsics.atomic_pointermodify || # this one is never effect-free
2947+
f === Intrinsics.atomic_pointerreplace || # this one is never effect-free
29432948
f === Intrinsics.llvmcall || # this one is never effect-free
29442949
f === Intrinsics.sqrt_llvm_fast || # this one may differ at runtime (by a few ulps)
29452950
f === Intrinsics.have_fma || # this one depends on the runtime environment

stdlib/REPL/test/replcompletions.jl

Lines changed: 6 additions & 0 deletions
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)