Article View: gnu.gcc.help
Article #50859GCC sparc 16-bit struct alignment
From: John Michaloski
Date: Tue, 20 Jul 1993 20:12
Date: Tue, 20 Jul 1993 20:12
38 lines
1939 bytes
1939 bytes
My question is, "How do you change the default SPARC structure boundaries to
align along 16-bit boundaries instead of 32-bit?" When I use
GNU C version 2.4.5 (sparc) compiled by GNU C version 2.4.5.
it appears that the version of the gcc compiler we built aligns
structures to double pointer boundaries and not the anticipated 16 bit
boundaries.
Here is the problem in a source nutshell:
typedef struct goal_points {
int i ; /*==> sparc gcc 4 bytes is padded to 8 bytes*/
double x; /* 8 bytes */
double y; /* 8 bytes */
double z; /* 8 bytes */
} TEST;
On the SPARC, do doubles have to align on 32 bit boundaries? I need to
pass raw data from a Sparc board to a Motorola 680x0 board - which
aligns along 16-bit boundaries.
I have experimented with numerous Machine-Specific compiler flags but
have not figured out how to cure this ailment. I have tried the
following flags, to no avail:
#define PARM_BOUNDARY 16
#define EMPTY_FIELD_BOUNDARY 16
#define PCC_BITFIELD_TYPE_MATTERS
#define FASTEST_ALIGNMENT 16
Many def's appear to be ignored - no warning message of redefinition.
Thanks for any insight,
John Michaloski
michalos@cme.nist.gov
Technical Details
Message-ID:
<22342@anthem.cme.nist.gov>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!darwin.sura.net!haven.umd.edu!uunet!dove!cme!michalosShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,dff6f7c8f78400ee,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-07-20 15:09:02 PST Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!darwin.sura.net!haven.umd.edu!uunet!dove!cme!michalos From: michalos@cme.nist.gov (John Michaloski) Newsgroups: gnu.gcc.help Subject: GCC sparc 16-bit struct alignment Keywords: gcc sparc struct Message-ID: <22342@anthem.cme.nist.gov> Date: 20 Jul 93 20:12:49 GMT Organization: The National Institute of Standards and Technology Lines: 39