Re: question about attribute aligned for functions

2018-11-30 Thread Jeff Law
On 11/29/18 8:34 AM, Martin Sebor wrote: > > GCC does disallow decreasing the function alignment -- but only > for functions that were already declared with a more restrictive > one.  Like this: > >   __attribute__ ((aligned (4))) void f (void); > >   __attribute__ ((aligned (2))) void f (void);

Re: question about attribute aligned for functions

2018-11-29 Thread Martin Sebor
On 11/28/18 9:07 PM, Jeff Law wrote: On 11/27/18 11:57 AM, Martin Sebor wrote: On 11/26/18 3:37 PM, Jeff Law wrote: On 11/23/18 12:31 PM, Martin Sebor wrote: GCC currently accepts the declaration of f0 below but ignores the attribute.  On aarch64 (and I presume on other targets with a default

Re: question about attribute aligned for functions

2018-11-28 Thread Jeff Law
On 11/27/18 11:57 AM, Martin Sebor wrote: > On 11/26/18 3:37 PM, Jeff Law wrote: >> On 11/23/18 12:31 PM, Martin Sebor wrote: >>> GCC currently accepts the declaration of f0 below but ignores >>> the attribute.  On aarch64 (and I presume on other targets with >>> a default function alignment greate

Re: question about attribute aligned for functions

2018-11-28 Thread Martin Sebor
On 11/28/18 6:04 AM, Florian Weimer wrote: * Martin Sebor: At the same time, the following passes on x86_64: __attribute__ ((aligned (1))) void f1 (void) { } _Static_assert (__alignof__ (f1) == 1); // wrong alignof result __attribute__ ((aligned)) void f0 (void) { } _Static_asse

Re: question about attribute aligned for functions

2018-11-28 Thread Florian Weimer
* Martin Sebor: > At the same time, the following passes on x86_64: > > __attribute__ ((aligned (1))) void f1 (void) { } > _Static_assert (__alignof__ (f1) == 1); // wrong alignof result > > __attribute__ ((aligned)) void f0 (void) { } > _Static_assert (__alignof__ (f0) == 16); > > __a

Re: question about attribute aligned for functions

2018-11-27 Thread Martin Sebor
On 11/27/18 11:57 AM, Martin Sebor wrote: On 11/26/18 3:37 PM, Jeff Law wrote: On 11/23/18 12:31 PM, Martin Sebor wrote: GCC currently accepts the declaration of f0 below but ignores the attribute.  On aarch64 (and I presume on other targets with a default function alignment greater than 1), GC

Re: question about attribute aligned for functions

2018-11-27 Thread Martin Sebor
On 11/26/18 3:37 PM, Jeff Law wrote: On 11/23/18 12:31 PM, Martin Sebor wrote: GCC currently accepts the declaration of f0 below but ignores the attribute.  On aarch64 (and I presume on other targets with a default function alignment greater than 1), GCC rejects f1 with an error, even though it

Re: question about attribute aligned for functions

2018-11-26 Thread Jeff Law
On 11/23/18 12:31 PM, Martin Sebor wrote: > GCC currently accepts the declaration of f0 below but ignores > the attribute.  On aarch64 (and I presume on other targets with > a default function alignment greater than 1), GCC rejects f1 > with an error, even though it accepts -falign-functions=1 > wi

question about attribute aligned for functions

2018-11-23 Thread Martin Sebor
GCC currently accepts the declaration of f0 below but ignores the attribute. On aarch64 (and I presume on other targets with a default function alignment greater than 1), GCC rejects f1 with an error, even though it accepts -falign-functions=1 without as much as a warning. Clang, on the other ha