This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Aligned attribute incorrectly applied to a type.
- To: rth at cygnus dot com
- Subject: Re: [patch] Aligned attribute incorrectly applied to a type.
- From: Andrew Haley <aph at pasanda dot cygnus dot co dot uk>
- Date: 18 Jul 2000 14:48:18 -0000
- CC: clm at cygnus dot com, gcc-patches at gcc dot gnu dot org
> From: Richard Henderson <rth@cygnus.com>
> Newsgroups: cygnus.egcs.patches
> Date: Thu, 29 Jun 2000 14:31:43 -0700
>
> On Thu, Jun 29, 2000 at 02:03:13PM -0700, Catherine Moore wrote:
> > * c-common.c (decl_attributes): Differentiate between
> > types and type decls for alignment.
>
> Ok.
Why is this OK? Consider the following fragment:
typedef long __jmp_buf[70] __attribute__ ((aligned (64)));
typedef struct __jmp_buf_tag
{
__jmp_buf __jmpbuf;
int __mask_was_saved;
} jmp_buf[1];
jmp_buf foo;
After the decl_attributes patch is applied, the (aligned (64)) gets
appled to the decl `__jmp_buf' but not to the corresponding type; this
causes the type `jmp_buf' not to be aligned.
Perhaps in this case the alignment ought to be applied to both the
decl and the type.
Andrew.