fix not enough bits in pointer addresses when both local and nonlocal memory used
ADD
tests/alive-tv/memory/ptr-cmp.srctgt.ll
+define i1 @src(ptr %base, i64 %idx) {
+ %gep = getelementptr inbounds i8, ptr %base, i64 %idx
+ %cnd = icmp eq ptr %gep, null
+ %A = alloca i1, i32 0, align 1
+ ret i1 %cnd
+}
+
+define i1 @tgt(ptr %base, i64 %idx) {
+ %cnd = icmp eq ptr %base, null
+ ret i1 %cnd
+}

MODIFY
tools/transform.cpp
tools/transform.cpp
@@ -1031,7 +1031,7 @@ static void calculateAndInitConstants(Transform &t) {
// as an (unsound) optimization, we fix the first bit of the addr for
// local/non-local if both exist (to reduce axiom fml size)
bool has_local_bit = (num_locals_src || num_locals_tgt) && num_nonlocals;
- bits_ptr_address = min(max(bits_size_t, bits_ptr_address + has_local_bit),
+ bits_ptr_address = min(max(bits_size_t, bits_ptr_address) + has_local_bit,
bits_program_pointer);
bits_byte = 8 * (does_mem_access ? (unsigned)min_access_size : 1);

fix #792: not enough bits in pointer addresses when both local and nonlocal memory used