[PATCH] D11948: Add some macros to abstract marking of parameters as "not null", and use them in <cstring>

Marshall Clow via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 12 15:42:01 PDT 2015


On Tue, Aug 11, 2015 at 2:28 PM, Joerg Sonnenberger via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> On Tue, Aug 11, 2015 at 02:06:58PM -0700, Marshall Clow via cfe-commits
> wrote:
> > On Tue, Aug 11, 2015 at 1:34 PM, Dan Albert <danalbert at google.com>
> wrote:
> >
> > > Yeah, those sound like exactly what we want. Helping people find UB is
> > > good, but optimizing assuming we've fixed all of the UB isn't
> something we
> > > can do.
> > >
> >
> > Dan -- that's the situation you're in today.
> > GCC has done that kind of optimization for *years*.
>
> Only on platforms that use this markup. Which is exactly the point I am
> raising. The gain by this optimisation is questionable at best and it
> has created (or exposed, however you want to call it) non-trivial bugs
> in the real world. There is a reason why there is a lot of push back
> outside glibc for this markers.
>
>
I don't think that this is true.

My tests (from a previous message - run on a Mac, which does not use glibc)
show that gcc recognizes this and optimizes based on that.

-- Marshall
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150812/2a7c6c46/attachment.html>


More information about the cfe-commits mailing list