On Tue, Mar 16, 2010 at 9:05 PM, Tristan Gingold <ging...@adacore.com> wrote:
>
> On Mar 16, 2010, at 3:50 PM, H.J. Lu wrote:
>
>> 2010/3/8 Paweł Sikora <pl...@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 via email to