public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <richard.guenther@gmail.com>
To: "Paweł Sikora" <pluto@agmk.net>
Cc: gcc@gcc.gnu.org
Subject: Re: (un)aligned accesses on x86 platform.
Date: Mon, 08 Mar 2010 15:46:00 -0000	[thread overview]
Message-ID: <84fc9c001003080746p775b14b4s105ed0ddbf4a2fb1@mail.gmail.com> (raw)
In-Reply-To: <op.u889o5kpzu3k57@pawels.alatek.krakow.pl>

2010/3/8 Paweł Sikora <pluto@agmk.net>:
> 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?

Only by re-building it and setting STRICT_ALIGNMENT.

Richard.

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

  parent reply	other threads:[~2010-03-08 15:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-08 15:37 Paweł Sikora
2010-03-08 15:45 ` Andrew Pinski
2010-03-08 15:46 ` Richard Guenther [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84fc9c001003080746p775b14b4s105ed0ddbf4a2fb1@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=pluto@agmk.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).