This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: __builtin_memcpy and alignment assumptions


On Fri, Jan 08, 2016 at 12:24:49PM +0100, Eric Botcazou wrote:
> > See some existing PR.  The GCC middle-end cannot assume that pointers
> > are aligned according to their type (while at least the C language would
> > support that notion).
> 
> Only on x86.  It could (and used to) do it on strict-alignment architectures.

I think we only assume it if the pointer is actually dereferenced, otherwise
it just breaks too much code in the wild.  And while memcpy dereferences, it
dereferences it through a char * cast, and thus only the minimum alignment
is assumed.

	Jakub


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