[llvm-commits] [llvm] r64352 - /llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp

Duncan Sands baldrick at free.fr
Thu Feb 12 02:03:35 PST 2009


On Thursday 12 February 2009 10:57:03 Eli Friedman wrote:
> On Thu, Feb 12, 2009 at 1:08 AM, Duncan Sands <baldrick at free.fr> wrote:
> > If we decided that nocapture means: "(really not captured) or (captured,
> > but did something which results in undefined alias analysis results)",
> > and say that pointer swizzling results in undefined alias analysis behavior,
> > then all arguments to printf could be marked nocapture I guess.
> 
> I think it's pretty clearly legal to printf the value of a pointer to
> a file, read it back in, and dereference it, although it's certainly a
> bit unusual.

I'm told that the C standard (not the only relevant standard, but an
important one) says that you are allowed to assume that the resulting
pointer does not alias the original pointer.  Note that I'm only saying
"undefined for the purposes of alias analysis", not that doing this kind
of thing is undefined in the general sense.

Ciao,

Duncan.



More information about the llvm-commits mailing list