[PATCH] D114988: [IR] `GetElementPtrInst`: per-index `inrange` support
Bruno De Fraine via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 7 11:36:36 PDT 2022
brunodf added a comment.
Sorry, I'm late to read this diff.
In D114988#3171000 <https://reviews.llvm.org/D114988#3171000>, @efriedma wrote:
> Consider the following:
>
> struct S {
> int a[3], b[3], c[3];
> };
>
> int foo(S* s) {
> return &s.a[3] == &s.b[0];
> }
>
> The C standard says this returns 1; if you lower the address computation using inrange, it returns poison. I think?
Could you clarify how the C standard guarantees this will return 1? I think the standard allows padding between struct members a and b (even though I see very little reason to add padding here) so the comparison does not have a defined result.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114988/new/
https://reviews.llvm.org/D114988
More information about the llvm-commits
mailing list