public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexey Salmin <alexey.salmin@gmail.com>
To: Tristan Gingold <gingold@adacore.com>
Cc: "H.J. Lu" <hjl.tools@gmail.com>, "Paweł Sikora" <pluto@agmk.net>,
	gcc@gcc.gnu.org
Subject: Re: (un)aligned accesses on x86 platform.
Date: Tue, 16 Mar 2010 15:48:00 -0000	[thread overview]
Message-ID: <87a8dc11003160837u14c2fdfenef62c73c851344ce@mail.gmail.com> (raw)
In-Reply-To: <170A1D5F-CF9E-405F-9056-3D23FBE9F130@adacore.com>

On Tue, Mar 16, 2010 at 9:05 PM, Tristan Gingold <gingold@adacore.com> wrote:
>
> On Mar 16, 2010, at 3:50 PM, H.J. Lu wrote:
>
>> 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?
>>>
>>> [1] "AC" bit - http://en.wikipedia.org/wiki/FLAGS_register_(computing)
>>>
>>
>> I am interested in an -mstrict-alignment option for x86.
>
> Not sure it will be useful.  The libc still does unaligned accesses IIRC.
>
>

Wow. What for?

Alexey

  reply	other threads:[~2010-03-16 15:37 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
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 [this message]
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=87a8dc11003160837u14c2fdfenef62c73c851344ce@mail.gmail.com \
    --to=alexey.salmin@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=gingold@adacore.com \
    --cc=hjl.tools@gmail.com \
    --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).