[Bug middle-end/78995] A strange copy error caused by O3 optimization
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 5 09:33:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78995
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution|--- |INVALID
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
static inline void
rte_memcpy(void *dst, const void *src, size_t n)
{
uintptr_t dstu = (uintptr_t)dst;
uintptr_t srcu = (uintptr_t)src;
*(uint32_t *)dstu = *(const uint32_t *)srcu;
this is violating strict aliasing rules as you are copying
typedef unsigned short WORD;
struct TFieldHeader
{
WORD FieldID;
WORD Size;
};
More information about the Gcc-bugs
mailing list