···38383939### Internal/compiler-libs changes:
40404141+- #12216, #12248: Prevent reordering of atomic loads during instruction
4242+ scheduling. This is for reference, as instruction scheduling is currently
4343+ unused in OCaml 5.
4444+ (Xavier Leroy, report by Luc Maranget and KC Sivaramakrishnan,
4545+ review by Nicolás Ojeda Bär)
4646+4147### Build system:
42484349### Bug fixes:
+6-1
asmcomp/schedgen.ml
···181181 Can be overridden for some processors to signal specific
182182 load or store instructions (e.g. on the I386). *)
183183184184+(* Stores are not reordered with other stores nor with loads.
185185+ Loads can be reordered with other loads, but not with stores.
186186+ Atomic loads must not be reordered, so we treat them like stores. *)
187187+184188method is_store = function
185189 Istore(_, _, _) -> true
190190+ | Iload {is_atomic = true} -> true
186191 | _ -> false
187192188193method is_load = function
189189- Iload _ -> true
194194+ Iload {is_atomic = false} -> true
190195 | _ -> false
191196192197method is_checkbound = function
+3-2
asmcomp/schedgen.mli
···3737 method oper_in_basic_block : Mach.operation -> bool
3838 (* Says whether the given operation terminates a basic block *)
3939 method is_store : Mach.operation -> bool
4040- (* Says whether the given operation is a memory store *)
4040+ (* Says whether the given operation is a memory store
4141+ or an atomic load. *)
4142 method is_load : Mach.operation -> bool
4242- (* Says whether the given operation is a memory load *)
4343+ (* Says whether the given operation is a non-atomic memory load *)
4344 method is_checkbound : Mach.operation -> bool
4445 (* Says whether the given operation is a checkbound *)
4546 (* Entry point *)