[llvm-commits] [llvm] r92411 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/load-cmp.ll

Duncan Sands baldrick at free.fr
Mon Jan 4 10:17:32 PST 2010


Hi Bill,

>> nice transform.  However if this is not an inbounds GEP and the index "i" is
>> > 64 bits on a 32 bit machine, then there are other possible values for "i",
>> > such as i == 6 + 232.
>> > 
> At least in C, accessing outside of an array is undefined. Isn't this a case of "they get what they deserve"?  :-) 

front-ends should turn C array accesses into inbounds GEPs, so my comment
wouldn't apply to code coming from C.  In fact it probably doesn't apply
to code from any language - it's a theoretical correctness issue rather
than a practical one :)  I guess it can be fixed by truncating i to the
pointer size for the target before doing the compare.

Ciao,

Duncan.



More information about the llvm-commits mailing list