https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94158
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- GCC assumes pointers returned by malloc are at least MALLOC_ABI_ALIGNMENT bytes aligned. That is because: "The pointer returned if the allocation succeeds is suitably aligned so that it may be assigned to a pointer to any type of object and then used to access such an object or an array of such objects in the space allocated (until the space is explicitly deallocated)." glibc normally guarantees 2 * sizeof (void *) alignment, GCC by default assumes just a wordsize alignment. So, if your malloc replacement doesn't provide such alignment, it is incorrect.