Example: intptr3a.c

up: index
prev: intptr3.c
next: intptr4.c

    #include <stdint.h>
    #include <stdio.h>
    #include <cheriintrin.h>
    
    int main()
    {
        int x[2]={42,43};
    
        // Regular array shift
        int *p  = x;
        int *p1 = p+1;
        
        // intptr addition
        intptr_t ip = (intptr_t)p;
        intptr_t ip1 = sizeof(int) + ip;
        int *p2 = (int*) ip1;
        
        fprintf(stderr,"Pointers %s\n",
                cheri_is_equal_exact(p1,p2)?"exactly equal":"not equal");
    }

Experimental data (what does this mean?)

clang-riscv-O3-bounds-subobject-safe cheri-bound-allocas: Don't know how to handle intrinsic. Assuming bounds needed %8 = call i1 @llvm.cheri.cap.equal.exact(i8 addrspace(200)* %7, i8 addrspace(200)* %4), !dbg !43cheri-bound-allocas: Don't know how to handle intrinsic. Assuming bounds needed %8 = call i1 @llvm.cheri.cap.equal.exact(i8 addrspace(200)* %7, i8 addrspace(200)* %4), !dbg !43cheri-bound-allocas: Don't know how to handle intrinsic. Assuming bounds needed %9 = call i1 @llvm.cheri.cap.equal.exact(i8 addrspace(200)* %8, i8 addrspace(200)* %5), !dbg !43cheri-bound-allocas: Don't know how to handle intrinsic. Assuming bounds needed %8 = call i1 @llvm.cheri.cap.equal.exact(i8 addrspace(200)* %7, i8 addrspace(200)* %4), !dbg !43cheri-bound-allocas: Don't know how to handle intrinsic. Assuming bounds needed %8 = call i1 @llvm.cheri.cap.equal.exact(i8 addrspace(200)* %7, i8 addrspace(200)* %4), !dbg !43cheri-bound-allocas: Don't know how to handle intrinsic. Assuming bounds needed %6 = call i1 @llvm.cheri.cap.equal.exact(i8 addrspace(200)* nonnull %add.ptr, i8 addrspace(200)* %3), !dbg !43cheri-bound-allocas: Don't know how to handle intrinsic. Assuming bounds needed %6 = call i1 @llvm.cheri.cap.equal.exact(i8 addrspace(200)* nonnull %add.ptr, i8 addrspace(200)* %3), !dbg !43cheri-bound-allocas: Don't know how to handle intrinsic. Assuming bounds needed %4 = call i1 @llvm.cheri.cap.equal.exact(i8 addrspace(200)* nonnull %add.ptr, i8 addrspace(200)* %add.ptr), !dbg !42cheri-bound-allocas: Don't know how to handle intrinsic. Assuming bounds needed %4 = call i1 @llvm.cheri.cap.equal.exact(i8 addrspace(200)* nonnull %add.ptr, i8 addrspace(200)* %add.ptr), !dbg !42cheri-bound-allocas: Don't know how to handle intrinsic. Assuming bounds needed %4 = call i1 @llvm.cheri.cap.equal.exact(i8 addrspace(200)* nonnull %add.ptr, i8 addrspace(200)* %add.ptr), !dbg !42cheri-bound-allocas: Don't know how to handle intrinsic. Assuming bounds needed %4 = call i1 @llvm.cheri.cap.equal.exact(i8 addrspace(200)* nonnull %add.ptr, i8 addrspace(200)* %add.ptr), !dbg !42cheri-bound-allocas: Don't know how to handle intrinsic. Assuming bounds needed %4 = call i1 @llvm.cheri.cap.equal.exact(i8 addrspace(200)* nonnull %add.ptr, i8 addrspace(200)* %add.ptr), !dbg !42cheri-bound-allocas: Don't know how to handle intrinsic. Assuming bounds needed %4 = call i1 @llvm.cheri.cap.equal.exact(i8 addrspace(200)* nonnull %add.ptr, i8 addrspace(200)* %add.ptr), !dbg !42cheri-bound-allocas: Don't know how to handle intrinsic. Assuming bounds needed %4 = call i1 @llvm.cheri.cap.equal.exact(i8 addrspace(200)* nonnull %add.ptr, i8 addrspace(200)* %add.ptr), !dbg !42Pointers exactly equal
 
clang-riscv-O3-bounds-conservative cheri-bound-allocas: Don't know how to handle intrinsic. Assuming bounds needed %5 = call i1 @llvm.cheri.cap.equal.exact(i8 addrspace(200)* nonnull %4, i8 addrspace(200)* nonnull %2), !dbg !42Pointers exactly equal
 
gcc-morello-O0
gcc-morello-O3
clang-morello-O0-bounds-conservative
clang-morello-O3-bounds-conservative
clang-morello-O0-bounds-references-only
clang-morello-O0-bounds-subobject-safe
clang-morello-O3-bounds-subobject-safe
clang-morello-O0-bounds-aggressive
clang-morello-O0-bounds-very-aggressive
clang-morello-O0-bounds-everywhere-unsafe
clang-riscv-O0-bounds-conservative
clang-riscv-O0-bounds-references-only
clang-riscv-O0-bounds-subobject-safe
clang-riscv-O0-bounds-aggressive
clang-riscv-O0-bounds-very-aggressive
clang-riscv-O0-bounds-everywhere-unsafe
cerberus-cheri
cerberus-cheri-no-pnvi
cerberus-cheri-revocation
cerberus-cheri-revocation-no-pnvi
cerberus-cheri-cornucopia
cerberus-cheri-cornucopia-no-pnvi
 Pointers exactly equal