[llvm-commits] [llvm] r159173 - in /llvm/trunk: lib/Transforms/Scalar/SimplifyLibCalls.cpp test/Transforms/SimplifyLibCalls/2009-01-04-Annotate.ll

Nuno Lopes nunoplopes at sapo.pt
Mon Jun 25 16:22:31 PDT 2012


Quoting Eli Friedman <eli.friedman at gmail.com>:

> On Mon, Jun 25, 2012 at 3:55 PM, Nuno Lopes <nunoplopes at sapo.pt> wrote:
>> Author: nlopes
>> Date: Mon Jun 25 17:55:50 2012
>> New Revision: 159173
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=159173&view=rev
>> Log:
>> do not set realloc() as NotAlias, since it can return the same pointer.
>
> Strictly speaking, realloc as defined by the C99 standard is in fact
> noalias... even if the returned value is "the same", it doesn't refer
> to the same object in aliasing terms.
>
> -Eli

Oops. I see.  Basically you're saying that accessing a pointer that  
was passed to realloc is undef behavior, so we can safely mark the  
return of realloc as notAlias.
Ok, cool, reverting the patch..

Thanks for the heads up!
Nuno



More information about the llvm-commits mailing list