On Tue, May 27, 2025 at 03:53:02PM +0100, Jonathan Wakely wrote: > On Tue, 27 May 2025 at 15:48, Segher Boessenkool wrote: > > Most of the compiler support routines used by GCC are present in > > 'libgcc', but there are a few exceptions. GCC requires the freestanding > > environment provide 'memcpy', 'memmove', 'memset' and 'memcmp'. > > Contrary to the standards covering 'memcpy' GCC expects the case of an > > exact overlap of source and destination to work and not invoke undefined > > behavior. Finally, if '__builtin_trap' is used, and the target does not > > implement the 'trap' pattern, then GCC emits a call to 'abort'. > > > > (https://gcc.gnu.org/onlinedocs/gcc-15.1.0/gcc/Standards.html#C-Language, > > the one but last paragraph) > > Thanks! I thought we had that documented somewhere but tried (briefly) > to find it, and failed. I remember this was in the GCC docs thirty or so years ago already. The trick as always is knowing what to look for :-) memcpy isn't such a great search term, but searching the GCC docs for memcmp helps. I haven't managed to figure out anything that will direct Google to a correct (or even reasonable!) answer though. Maybe the mail archive for this thread will help! Segher