[llvm-commits] [llvm] r89915 - /llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp

Chris Lattner sabre at nondot.org
Thu Nov 26 12:18:46 PST 2009


On Nov 26, 2009, at 10:33 AM, Duncan Sands wrote:

>>> what if this wraps around the entire address space and lands back on top of
>>> the original pointer?
>> Then that's undefined behavior.
> 
> I thought it was only undefined for inbounds GEP?  I'm a bit worried about this
> because I have a testcase in which the optimizers changed increments by -4 into
> increments by 2^32 - 4, which would mean that they are creating undefined
> behaviour where there was none before (PR5282).

This isn't related, it is looking at the access size in this code, not the stride.  The scales are explicitly truncated to pointer size here:

      // Make sure that we have a scale that makes sense for this target's
      // pointer size.
      if (unsigned ShiftBits = 64-TD->getPointerSizeInBits()) {
        Scale <<= ShiftBits;
        Scale >>= ShiftBits;
      }

so it will be handled as -4, not "something crazy".

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20091126/0bd1d71e/attachment.html>


More information about the llvm-commits mailing list