[PATCH] D115167: [DSE] Use precise loc for memset_chk writing to local objects.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 6 10:59:03 PST 2021


efriedma added a comment.

A couple thoughts:

1. We need to be careful using the exact memset size.  We could end up with an "impossible" memory location: for example, setting 100 bytes of a 50-byte buffer.  That's probably okay here?  But maybe not in other contexts; we need to be sure we don't treat memset_chk as UB.  Maybe worth a comment describing what, exactly, we're modeling.
2. In the case where the bounds check in memset_chk fails, it just aborts the process, and there isn't any synchronization point before it does that.  So I'm not sure why it matters if the pointer is visible to other threads.  Another thread can't read the contents before the process abort because it would be unsynchronized, and the memory doesn't exist after the process aborts.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115167/new/

https://reviews.llvm.org/D115167



More information about the llvm-commits mailing list