[PATCH] D47895: llvm: Add support for "-fno-delete-null-pointer-checks"

Manoj Gupta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 3 09:10:01 PDT 2018


manojgupta added a comment.

In https://reviews.llvm.org/D47895#1150325, @george.burgess.iv wrote:

> Swooping in on this admittedly quite late: should the objectsize bits in MemoryBuiltins.cpp be made aware of this?
>
> In particular, the `ObjectSizeOffsetVisitor` will happily hand you "0 bytes are accessible here" if you hand it null (...though not if you ask it via `__builtin_object_size`, since that has a gcc-compat hack around NULL, as well). We should probably make the `NullIsUnknownSize` field we pass into that factor in whether the current `Function` has this new null-is-ok attribute on it.
>
> ...Since it's possible for us to just hand it a `ConstantPointerNull` without a `Function` attached, we probably need to plumb this in from callers of `llvm::getObjectSize`/`llvm::lowerObjectSizeCall`/...


I don't know much about   `__builtin_object_size` but I think GCC compatibility is the key here.  Does GCC returns different results for `__builtin_object_size` when  "-fno-delete-null-pointer-checks" is specified?


Repository:
  rL LLVM

https://reviews.llvm.org/D47895





More information about the llvm-commits mailing list