Re: [PATCH] Use ATTRIBUTE_PACKED in ree.c

2012-11-28 Thread Richard Earnshaw
On 28/11/12 15:05, Jakub Jelinek wrote: On Wed, Nov 28, 2012 at 03:02:12PM +, Richard Earnshaw wrote: #if (GCC_VERSION < 2007) # define __attribute__(x) #endif ... #ifndef ATTRIBUTE_PACKED # define ATTRIBUTE_PACKED __attribute__ ((packed)) #endif So in theory it should expand to nothing for

Re: [PATCH] Use ATTRIBUTE_PACKED in ree.c

2012-11-28 Thread Jakub Jelinek
On Wed, Nov 28, 2012 at 03:02:12PM +, Richard Earnshaw wrote: > >#if (GCC_VERSION < 2007) > ># define __attribute__(x) > >#endif > >... > >#ifndef ATTRIBUTE_PACKED > ># define ATTRIBUTE_PACKED __attribute__ ((packed)) > >#endif > > > >So in theory it should expand to nothing for non-GCC compile

Re: [PATCH] Use ATTRIBUTE_PACKED in ree.c

2012-11-28 Thread Richard Earnshaw
On 22/11/12 07:52, Jakub Jelinek wrote: On Thu, Nov 22, 2012 at 12:26:01AM +0100, Eric Botcazou wrote: 2012-11-21 Jakub Jelinek * ree.c (struct ext_modified): Add ATTRIBUTE_PACKED. Are you sure that this will compile with non-GCC compilers? I'm not sure, but I hope it will. ansi

Re: [PATCH] Use ATTRIBUTE_PACKED in ree.c

2012-11-22 Thread Eric Botcazou
> I'm not sure, but I hope it will. ansidecl.h has > #ifndef GCC_VERSION > #define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) > #endif /* GCC_VERSION */ > ... > #if (GCC_VERSION < 2007) > # define __attribute__(x) > #endif > ... > #ifndef ATTRIBUTE_PACKED > # define ATTRIBUTE_PACKED __attribut

Re: [PATCH] Use ATTRIBUTE_PACKED in ree.c

2012-11-21 Thread Jakub Jelinek
On Thu, Nov 22, 2012 at 12:26:01AM +0100, Eric Botcazou wrote: > > 2012-11-21 Jakub Jelinek > > > > * ree.c (struct ext_modified): Add ATTRIBUTE_PACKED. > > Are you sure that this will compile with non-GCC compilers? I'm not sure, but I hope it will. ansidecl.h has #ifndef GCC_VERSION #d

Re: [PATCH] Use ATTRIBUTE_PACKED in ree.c

2012-11-21 Thread Eric Botcazou
> 2012-11-21 Jakub Jelinek > > * ree.c (struct ext_modified): Add ATTRIBUTE_PACKED. Are you sure that this will compile with non-GCC compilers? -- Eric Botcazou

[PATCH] Use ATTRIBUTE_PACKED in ree.c

2012-11-21 Thread Jakub Jelinek
Hi! The PR55430 miscompilation of ree.c by LRA lead me to look at this structure, which was really meant to be just 2 byte long, but is unnecessarily 4 byte long. As it only contains 8, 2 and 1 bit bitfields, it can always (except old alphas) be accessed by 1 byte loads/stores, so packed attribut