[LLVMdev] LLVM 2.4 problem? (resend)

Nick Lewycky nicholas at mxc.ca
Wed Oct 15 08:26:52 PDT 2008


Duncan Sands wrote:
>> True, but note that it is the address of a variable that is used, not  
>> the value.
> 
> Yes, but why do you think they should get a different address?  I can
> understand that it is surprising that they do, but determining whether
> this is legal or not requires reading the language standard.  Hopefully
> a language lawyer can chime in and say whether this transform is valid
> or not.

Change the return statement to:

   return test1 == test2;

LLVM will constant-fold that to false, which is inconsistent with the 
other optimization.

Nick

> 
> Ciao,
> 
> Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 




More information about the llvm-dev mailing list