This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix gcc.dg/pragma-align.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]