[PATCH] D87994: [LangRef] Clarify the behavior of memory access instructions when pointers/sizes aren't well-defined

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 16:27:00 PDT 2020


aqjune added a comment.

In D87994#2295457 <https://reviews.llvm.org/D87994#2295457>, @eugenis wrote:

> MSan will complain about any undefined bits in a pointer.
> We have not seen a false positive caused by this so far, but it sounds like we should relax the requirement. Does it make sense for MSan to allow undef in the lower bits up to the known dereferenceable range of the pointer?

I think it depends on whether the frontend languages support nondeterministic accesses.
Optimizations cannot introduce undef bits to the pointers in general, because it can change a program that deterministically accesses memory locations to a program that nondeterministically does it.
if it is illegal for the frontend languages (that MSan is targetting) to generate such pointers, I think the check is still valid.
Also, even if it is not UB, it might be still useful - D86000 <https://reviews.llvm.org/D86000> detects behavior that isn't undefined but is practically problematic as well, so it might be okay.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87994



More information about the llvm-commits mailing list