[LLVMbugs] [Bug 18460] AA incorrect NoAlias result

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jan 15 20:53:43 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18460

Arnold Schwaighofer <aschwaighofer at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Arnold Schwaighofer <aschwaighofer at apple.com> ---
We were stripping one GEP such that the query ended up as

GEP1 = get <ptr>, -1, ...
GEP1Size = 8
V2Size = Unknown
V2 = <ptr>  (before we stripped the gep this also was "gep <ptr>, -1, ...")

aliasGEP(GEP1, GEP1Size, V2, V2Size)

which goes to the following logic in aliasGEP around line 1011:

       // GEP1BaseOffset < 0
       if (V1Size != UnknownSize) {
         if (-(uint64_t)GEP1BaseOffset < V1Size)
           return PartialAlias;
         return NoAlias;


The problem is that this code assumes that the address expression that has V2
as subexpression only extends forward in memory. This does not hold true if the
stripped gep had a negative index which was the case here (V2Size ==
UnknownSize).

+                +
| BaseOffset     |
---------------->|
|-->V1Size       |-------> V2Size
GEP1             V2

In this case we also need to make sure that V2Size is not UnknownSize (as a gep
with negative index could have been stripped).


Fixed in r199351.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140116/193fa71a/attachment.html>


More information about the llvm-bugs mailing list