> > 
> > I do not think LTO is of any help here.  You can allways call non-LTO
> > const function from outer-world and that function can will end up
> > calling back to instrumented const function in your unit which
> > effectively makes the extenral const function non-const.
> 
> Hmm, true.
> 
> > > 
> > > That said, when there's a definition of say strlen in a TU and
> > > that's instrumented we do want to drop pure from calls but if
> > > not then we shouldn't worry.
> > > 
> > > Without LTO we'd still run into coverage issues but at least
> > > with LTO we shouldn't ICE?
> > 
> > I am not sure I see your point here...
> > We could avoid demoting builtins to avoid ICEs and have coverage
> > mismathces, but how LTO makes difference?
> 
> At least we get more functions local, but yes, we can still trigger
> the issue.
> 
> So what's the solution?  All functions that are not leaf or possibly
> instrumented have to be called as if they were not pure/const,
> including builtins?  As we've said we're going to ICE quite a bit
> when const/pure builtins suddenly are no longer const/pure.

Yep, I can't think of any easier solution than handling all functions as
not pure/const as soon as something instrumented is ever inlined to a
given function.  For builtins this is fun indeed.  We can special case
those that are always expanded inline at least...

Honza
> 
> Richard.

Reply via email to