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

--- Comment #15 from joseph at codesourcery dot com <joseph at codesourcery dot 
com> ---
On Sun, 24 Apr 2016, lopresti at gmail dot com wrote:

> That said, this is clearly a real bug in GCC. memcpy has a well-defined
> interface; GCC emits calls violating that interface; therefore GCC is buggy. I
> do not see why this is even controversial. (Also see Julian Seward's
> description of real-world problems in comment 5.)

As far as I know, that does not describe real-world problems on any target 
supported by GCC.

> GCC either needs to provide its own mempcy or it needs to respect the
> interface. The cost of the latter is surely trivial, especially since many
> cases could be optimized by alias analysis.

Or it could simply document an additional requirement on the C library 
used with GCC (that the case of exact overlap works), just as it documents 
the requirement that some functions such as memcpy be provided even in the 
freestanding case.  The compiler and library implementations need to 
cooperate to produce a conforming C implementation.

Reply via email to