[PATCH] D50039: [LibCalls] Added nonnull atribute to libc function args

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 31 14:04:40 PDT 2018


xbolva00 added a comment.

int foo(void *p, int n) {

  memset(p, 0, 0);
  if (!p)
      abort();
  return 1;

}
is not optimized by GCC.

Shouldn't we just do it like GCC? Do not optimize when explicit NULL or zero, otherwise be optimistic.


Repository:
  rL LLVM

https://reviews.llvm.org/D50039





More information about the llvm-commits mailing list