From: Jim Wilson <wilson@specifixinc.com>
To: Anil Paranjape <AnilP1@KPITCummins.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Ping : H8/300 ABI Document
Date: Thu, 01 Apr 2004 20:58:00 -0000 [thread overview]
Message-ID: <406C8284.6000205@specifixinc.com> (raw)
In-Reply-To: <69595093233BB547BB70CF5E492B63F204B96BAE@sohm.kpit.com>
Anil Paranjape wrote:
> Structure Alignment
> Unless __attribute__ ((packed)) is attached to the declaration of a struct, each structure member is aligned
> to a multiple of 2 bytes on H8/300 and of 4 bytes on H8/300H and H8S.
This is a maximum. Fields get natural alignment (alignment same as
size) up to this maximum. So shorts are always 2 byte aligned, but
4-byte ints get 2-byte alignment on H8/300 and 4-byte alignment on H8S.
Structure alignment is the max of the alignment of all fields.
Your suggested wording is not correct. The structure in your example
still has only 2-byte alignment even whwn compiled for H8S.
.comm _t,4,2
gives it a 4-byte size and 2-byte alignment. This is because shorts
always have 2-byte alignment.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
next prev parent reply other threads:[~2004-04-01 20:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-30 13:10 Anil Paranjape
2004-04-01 20:58 ` Jim Wilson [this message]
2004-04-02 8:44 Anil Paranjape
2004-04-05 23:57 ` Jim Wilson
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=406C8284.6000205@specifixinc.com \
--to=wilson@specifixinc.com \
--cc=AnilP1@KPITCummins.com \
--cc=gcc@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).