http://llvm.org/bugs/show_bug.cgi?id=18095
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |[email protected] Resolution|--- |INVALID --- Comment #2 from [email protected] --- As you said, this is undefined behavior (as the NULL pointer does not point to the element of an array object, cf. C99 6.5.6p8), so the compiler can do whatever it wants -- which includes assuming that the pointer will never be NULL. There is a nice series of blog posts on the LLVM blog that goes into some detail on how compilers exploit undefined behavior for optimization: <http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html> Another paper on the subject is "Undefined Behavior: What Happened to My Code?": <http://people.csail.mit.edu/akcheung/papers/apsys12.html> -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ LLVMbugs mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs
