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

Shiva Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 17:23:49 PDT 2018


shiva0217 added a comment.

In https://reviews.llvm.org/D45510#1066136, @dberlin wrote:

> 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)


Hi @dberlin. Thanks for the comments. So it's a language restriction which is illegal! Would you mind point me out which rule in C99 mention this restriction or the threads relative to this topic we could follow?


Repository:
  rL LLVM

https://reviews.llvm.org/D45510





More information about the llvm-commits mailing list