r281277 - [Sema] Fix PR30346: relax __builtin_object_size checks.

Joerg Sonnenberger via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 13 14:00:35 PDT 2016


On Tue, Sep 13, 2016 at 12:51:52PM -0700, Richard Smith wrote:
> On Tue, Sep 13, 2016 at 10:44 AM, Joerg Sonnenberger via cfe-commits <
> cfe-commits at lists.llvm.org> wrote:
> 
> > IMO this should be restricted to code that explicitly disables C/C++
> > aliasing rules.
> 
> 
> Do you mean -fno-strict-aliasing or -fno-struct-path-tbaa or something else
> here? (I think we're not doing anyone any favours by making _FORTIFY_SOURCE
> say that a pattern is OK in cases when LLVM will in fact optimize on the
> assumption that it's UB, but I don't recall how aggressive
> -fstruct-path-tbaa is for trailing array members.)

The former immediately, the latter potentially as well. I can't think of
many use cases for this kind of idiom that don't involve type prunning
and socket code is notoriously bad in that regard by necessity.

Joerg


More information about the cfe-commits mailing list