[PATCH] D45510: [RFC][AliasAnalysis][BasicAA] Return MayAlias for the pointer plus variable offset to structure object member

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 12:53:20 PDT 2018


dberlin added a comment.

This C case is actually not legal (it's been discussed before many times).
You cannot take the address of .a field, add an offset, and get to another field legally.
So i wouldn't express it in these terms, since in that language, this is clearly illegal.

The LLVM version, of course, does not make this undefined behavior AFAIK (which is a source of much imprecision)


Repository:
  rL LLVM

https://reviews.llvm.org/D45510





More information about the llvm-commits mailing list