[Bug middle-end/70140] Inefficient expansion of __builtin_mempcpy

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jul 18 07:18:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70140

--- Comment #8 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Wilco from comment #7)
> (In reply to Martin Liška from comment #6)
> > Created attachment 41772 [details]
> > Patch candidate
> > 
> > I'm going to prepare some test-cases for that. Does it look good?
> 
> Yes, it now inlines small constant sizes. However large and variable sized
> copies have the wrong return value:
> 
> void *f1(void *p, void *q) { return __builtin_mempcpy(p, q, 256); }
> 
> f1:
> 	mov	x2, 256
> 	b	memcpy

Yep, I've noticed. It's strange for me why it's not working. I've just asked at
GCC ML: https://gcc.gnu.org/ml/gcc/2017-07/msg00144.html


More information about the Gcc-bugs mailing list