Closed fhahn closed 6 months ago
My understanding is that dereferenceable
is valid at function entry. Then function @fn
may free that memory, and thus loading from that pointer may not be safe anymore.
If you tag @fn
with nofree
, the test goes through.
Test case https://alive2.llvm.org/ce/z/YrATgy
Alive2 claims UB is triggered after hoisting the load, but the pointer is marked as
dereferenceable(24)
, so speculatively loading 8 bytes should be fine, unless I am missing something.