llvm.org GIT mirror llvm / 4514930
BasicAA: fix bug where we would return partialalias instead of noalias My fix is conservative and will make us return may-alias instead. The test case is: check(gep(x, 0), n, gep(x, n), -1) with n == sizeof(x) Here, the first value accesses the whole object, but the second access doesn't access anything. The semantics of -1 is read until the end of the object, which in this case means read nothing. No test case, since isn't trivial to exploit this one, but I've proved it correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317680 91177308-0d34-0410-b5e6-96231b3b80d8 Nuno Lopes 2 years ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
16711671 // If both pointers are pointing into the same object and one of them
16721672 // accesses the entire object, then the accesses must overlap in some way.
16731673 if (O1 == O2)
1674 if ((V1Size != MemoryLocation::UnknownSize &&
1675 isObjectSize(O1, V1Size, DL, TLI)) ||
1676 (V2Size != MemoryLocation::UnknownSize &&
1674 if (V1Size != MemoryLocation::UnknownSize &&
1675 V2Size != MemoryLocation::UnknownSize &&
1676 (isObjectSize(O1, V1Size, DL, TLI) ||
16771677 isObjectSize(O2, V2Size, DL, TLI)))
16781678 return AliasCache[Locs] = PartialAlias;
16791679