memcpy() inlining and alignment

Geoff Keating
Fri Mar 3 17:37:00 GMT 2000

"Martin v. Loewis" <> writes:

> There is no mentioning of alignment constraints, and it says that it
> is copying characters. So I think the compiler is wrong in assuming
> that it can inline the memcpy using word-size instructions.

Elsewhere in the C standard it says that

	src = (struct s *)(cp + 1);

is not guaranteed to produce a valid 'struct s *'.  It is at that
point that undefined behaviour is invoked, after which anything can

- Geoffrey Keating <>

More information about the Gcc-bugs mailing list