[LLVMdev] Call to address 0 gets removed

Chris Lattner clattner at apple.com
Wed Jun 10 22:28:02 PDT 2009


On Jun 10, 2009, at 12:25 PM, John McCall wrote:

> There's another point that hasn't been raised yet here, which is that
> the
> undefinedness of calling (void*) 0 is a property of C, not necessarily
> of
> the LLVM abstract language.  I think you can make an excellent case  
> that
> the standard optimizations should not be enforcing C language  
> semantics,
> or at least should allow such optimizations to be disabled.

For the default address space, LLVM IR *should* currently treat load/ 
store to null as an undefined operation.  To support Java-style  
"potentially trapping" load/store, we need something like this:
http://nondot.org/sabre/LLVMNotes/ExceptionHandlingChanges.txt

-Chris



More information about the llvm-dev mailing list