This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: memcpy() inlining and alignment


"Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de> 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
happen.

-- 
- Geoffrey Keating <geoffk@cygnus.com>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]