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]

PATCH to *_USER_ALIGN


Currently, TYPE_USER_ALIGN will be set for all RECORD_TYPEs, and thence all
objects of such types.  Both of these seem wrong to me; we should only set
*_USER_ALIGN when we see an __attribute__ ((aligned)).

Tested i686-pc-linux-gnu, applied to trunk.

2001-08-16  Jason Merrill  <jason_merrill@redhat.com>

	* stor-layout.c (layout_decl): Don't set DECL_USER_ALIGN.
	(finalize_record_size): Don't set TYPE_USER_ALIGN.

*** stor-layout.c.~1~	Thu Aug 16 14:27:19 2001
--- stor-layout.c	Wed Jul 25 16:32:37 2001
*************** layout_decl (decl, known_align)
*** 372,378 ****
  	      && TYPE_ALIGN (type) > DECL_ALIGN (decl))))
      {	      
        DECL_ALIGN (decl) = TYPE_ALIGN (type);
!       DECL_USER_ALIGN (decl) = TYPE_USER_ALIGN (type);
      }
  
    /* For fields, set the bit field type and update the alignment.  */
--- 372,378 ----
  	      && TYPE_ALIGN (type) > DECL_ALIGN (decl))))
      {	      
        DECL_ALIGN (decl) = TYPE_ALIGN (type);
!       DECL_USER_ALIGN (decl) = 0;
      }
  
    /* For fields, set the bit field type and update the alignment.  */
*************** finalize_record_size (rli)
*** 993,999 ****
  #else
    TYPE_ALIGN (rli->t) = MAX (TYPE_ALIGN (rli->t), rli->record_align);
  #endif
!   TYPE_USER_ALIGN (rli->t) = 1;
  
    /* Compute the size so far.  Be sure to allow for extra bits in the
       size in bytes.  We have guaranteed above that it will be no more
--- 993,999 ----
  #else
    TYPE_ALIGN (rli->t) = MAX (TYPE_ALIGN (rli->t), rli->record_align);
  #endif
!   TYPE_USER_ALIGN (rli->t) = 0;
  
    /* Compute the size so far.  Be sure to allow for extra bits in the
       size in bytes.  We have guaranteed above that it will be no more


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