https://gcc.gnu.org/bugzilla/show_bug.cgi?id=129182
Alexander Monakov <amonakov at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amonakov at gcc dot gnu.org
--- Comment #3 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
memcpy is not necessary if you don't mind using the may_alias attribute:
void store32_unaligned(uint32_t val, void *p)
{
typedef uint32_t uint32_u __attribute__((aligned(1),may_alias));
*(uint32_u *)p = val;
}
(this has also other nice properties like reasonable code at -O0)