This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix gcc.dg/pragma-align.c
- From: Daniel Jacobowitz <drow at false dot org>
- To: Eric Botcazou <ebotcazou at libertysurf dot fr>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 4 Nov 2004 17:36:17 -0500
- Subject: Re: [PATCH] Fix gcc.dg/pragma-align.c
- References: <200411041208.00962.ebotcazou@libertysurf.fr>
On Thu, Nov 04, 2004 at 12:09:45PM +0100, Eric Botcazou wrote:
> Hello,
>
> The testcase fails on sparc64-sun-solaris2.* because the following test
>
> struct {
> char one;
> long two;
> } defaultalign;
>
> #pragma pack(4)
> struct {
> char one;
> long two;
> } sixteen;
>
> if(sizeof(sixteen) < sizeof(defaultalign)) abort();
>
> is wrong. We have because of the 64-bit ABI:
> sizeof(defaultalign) == 16;
> sizeof(sixteen) == 12;
>
> I propose to use #pragma pack(8) on LP64 targets. OK for mainline?
I apologize; when I changed this to a run test I lost the line which
changed the packing. I think it'd be fine to make the change
unconditionally and avoid the #ifdef; the intent of the test is pretty
clear...
--
Daniel Jacobowitz