From: Nuno Lopes Date: Tue, 8 Aug 2017 21:25:26 +0000 (+0000) Subject: BasicAA: assert on another case where aliasGEP shouldn't get a PartialAlias response X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b95a570738179e6047bf05bdc1f923afb02f8996;p=llvm BasicAA: assert on another case where aliasGEP shouldn't get a PartialAlias response git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310420 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index 9bd4349835e..180e5f4a644 100644 --- a/lib/Analysis/BasicAliasAnalysis.cpp +++ b/lib/Analysis/BasicAliasAnalysis.cpp @@ -1238,13 +1238,15 @@ AliasResult BasicAAResult::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size, AliasResult R = aliasCheck(UnderlyingV1, MemoryLocation::UnknownSize, AAMDNodes(), V2, MemoryLocation::UnknownSize, V2AAInfo, nullptr, UnderlyingV2); - if (R != MustAlias) + if (R != MustAlias) { // If V2 may alias GEP base pointer, conservatively returns MayAlias. // If V2 is known not to alias GEP base pointer, then the two values // cannot alias per GEP semantics: "Any memory access must be done through // a pointer value associated with an address range of the memory access, // otherwise the behavior is undefined.". + assert(R == NoAlias || R == MayAlias); return R; + } // If the max search depth is reached the result is undefined if (GEP1MaxLookupReached)