public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: linux-ia64@vger.kernel.org
Subject: Re: Unaligned access question
Date: Thu, 25 Sep 2003 08:32:25 +0000	[thread overview]
Message-ID: <marc-linux-ia64-106447880214230@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-106445366428887@msgid-missing>

[-- Attachment #1: Type: text/plain, Size: 980 bytes --]

Martin Pool <mbp@samba.org> writes:

> On 25 Sep 2003, Ian Wienand <ianw@gelato.unsw.edu.au> wrote:
>> Hi,
>> 
>> This isn't directly related to kernel development, but I am a bit
>> stumped as to why my test program below causes an unaligned access
>> when 'i' is 7 (that is, when it tries to access across a 64 bit
>> boundary of 'array').  It's counter intuitive to me, I would have
>> expected it either fault on all loads (for every value of 'i') or to
>> have not faulted at all.
>
> I think adding
>
>   __attribute__ ((aligned (1))) 

You cannot decrease alignment with the aligned attribute, for that you
need the packed attribute.  This sets alignment to 1, which you can
increase again with the aligned attribute.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

      parent reply	other threads:[~2003-09-25  8:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-25  1:34 Unaligned access question Ian Wienand
2003-09-25  2:04 ` Peter Chubb
2003-09-25  2:23 ` Martin Pool
2003-09-25  8:32 ` Andreas Schwab [this message]

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=marc-linux-ia64-106447880214230@msgid-missing \
    --to=schwab@suse.de \
    --cc=linux-ia64@vger.kernel.org \
    /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