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: (un)aligned accesses on x86 platform.


You define STRICT_ALIGNED to be 1 in i386.h or provide an option to turn that on/off like the rs6000 target does.

Thanks,
Andrew Pinski

Sent from my iPhone

On Mar 8, 2010, at 7:37 AM, PaweÅ Sikora <pluto@agmk.net> wrote:

hi,

during development a cross platform appliacation on x86 workstation
i've enabled an alignemnt checking [1] to catch possible erroneous
code before it appears on client's sparc/arm cpu with sigbus ;)

it works pretty fine and catches alignment violations but Jakub Jelinek
had told me (on glibc bugzilla) that gcc on x86 can still dereference
an unaligned pointer (except for vector insns).
i suppose it means that gcc can emit e.g. movl for access a short int
(or maybe others scenarios) in some cases and violates cpu alignment rules.


so, is it possible to instruct gcc-x86 to always use suitable loads/ stores
like on sparc/arm?


[1] "AC" bit - http://en.wikipedia.org/wiki/FLAGS_register_(computing)

BR,
Pawel.


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