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

D. Hugh Redelmeier <hugh at mimosa dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hugh at mimosa dot com

--- Comment #12 from D. Hugh Redelmeier <hugh at mimosa dot com> ---
JJ in #11 is right.

The compiler should never generate calls to functions with names in the user's
space.  That's because the user is allowed to (re)define anything with those
names and is not constrained to preserve expected semantics.

There should be a function in the reserved-to-system namespace that does what
is needed.  GCC should then call this function.

Let's say that GCC uses __memcpy.  The default standard definition of memcpy
could be a synonym (until redefinition) for __memcpy.

On the other hand, there are compile-time constraints on struct assignments
that could yield even better performance.  For example, GCC might know that the
object is a multiple of 8 bytes, aligned on an 8-byte boundary.  GCC would
certainly know that the struct's length is non-zero, conceptually eliminating
one test.  This suggests implementing specialized variants, perhaps having
names starting with __struct_assign.

(I know GCC has an extension allowing 0 length objects.  The assignment for
such objects could be eliminated.)

Reply via email to