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]

Re: [patch] Aligned attribute incorrectly applied to a type.


> 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.


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