[llvm-bugs] [Bug 43833] New: Deduce non-null if `gep inbounds` with non-zero offset is applied

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 29 00:49:05 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=43833

            Bug ID: 43833
           Summary: Deduce non-null if `gep inbounds` with non-zero offset
                    is applied
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Interprocedural Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: lebedev.ri at gmail.com
                CC: llvm-bugs at lists.llvm.org

https://godbolt.org/z/J1gBEU

void sink(int*);
void test(int* input, int len) {
    for(int i = 1; i < len; ++i)
        sink(input + len);
}

Currently the call to sink() isn't annotated with nonnull, but i think it can
be.
I'm not sure about legality check. It should be legal if i is never 0,
illegal if i is always 0, but what about if i increments from -1?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191029/9791ca22/attachment.html>


More information about the llvm-bugs mailing list