alive2
alive2 copied to clipboard
GEP does not produce the required 32-bit index truncation result
With 64-bit pointers and 32-bit pointer indices, alive-exec reports that a GEP with offset 4294967296 differs from its base pointer.
Program
target datalayout = "e-p:64:64:64:32"
define i32 @main() {
%p = inttoptr i64 1234 to ptr
%q = getelementptr i8, ptr %p, i64 4294967296
%c = icmp eq ptr %p, %q
%r = zext i1 %c to i32
ret i32 %r
}
Output
%p = #b10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001001101001000000000
%q = #b10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000001001101001000000000
%c = #b0
%r = #x00000000
Returned #x00000000 / non-poison=true