public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* (un)aligned accesses on x86 platform.
@ 2010-03-08 15:37 Paweł Sikora
  2010-03-08 15:45 ` Andrew Pinski
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Paweł Sikora @ 2010-03-08 15:37 UTC (permalink / raw)
  To: gcc

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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-03-17 15:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-08 15:37 (un)aligned accesses on x86 platform Paweł Sikora
2010-03-08 15:45 ` Andrew Pinski
2010-03-08 15:46 ` Richard Guenther
2010-03-08 21:11   ` Paweł Sikora
2010-03-16 15:05 ` H.J. Lu
2010-03-16 15:11   ` Tristan Gingold
2010-03-16 15:48     ` Alexey Salmin
2010-03-16 16:02       ` Tristan Gingold
2010-03-16 16:08         ` Alexey Salmin
2010-03-16 16:16           ` Piotr Wyderski
2010-03-16 18:31           ` Jakub Jelinek
2010-03-17 15:43   ` Mikael Pettersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).