On Thu, Apr 12, 2018 at 03:53:13PM +0000, Wilco Dijkstra wrote:
> Jakub Jelinek wrote:
> > On Thu, Apr 12, 2018 at 03:52:09PM +0200, Richard Biener wrote:
> >> Not sure if I missed some important part of the discussion but
> >> for the testcase we want to preserve the tailcall, right?  So
> >> it would be enough to set avoid_libcall to
> >> endp != 0 && CALL_EXPR_TAILCALL (exp) (and thus also handle
> >> stpcpy)?
> The tailcall issue is just a distraction. Historically the handling of 
> mempcpy  
> has been horribly inefficient in both GCC and GLIBC for practically all 
> targets.
> This is why it was decided to defer to memcpy.

I guess we need to agree to disagree.  But we have a P1 PR that we need to
resolve and it is one of the last 6 blockers we have.  I'm not suggesting to
revert PR70140, just let use mempcpy libcall if it is what the user wrote and
we aren't expanding it inline.

> So generally it's a good idea to change mempcpy into memcpy by default. It's


> not slower than calling mempcpy even if you have a fast implementation, it's 
> faster
> if you use an up to date GLIBC which calls memcpy, and it's significantly 
> better
> when using an old GLIBC.

mempcpy is quite good on many targets even in old GLIBCs.


Reply via email to