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]

Off-by-ones in layout_decl


Fri Apr 14 07:40:32 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* stor-layout.c (layout_decl): Properly compare KNOWN_ALIGN to
	see if DECL_BIT_FIELD needs to still be set.

*** stor-layout.c	2000/04/03 06:17:03	1.65
--- stor-layout.c	2000/04/14 11:26:23
*************** layout_decl (decl, known_align)
*** 352,356 ****
  	= mode_for_size_tree (DECL_SIZE (decl), MODE_INT, 1);
  
!       if (xmode != BLKmode && known_align > GET_MODE_ALIGNMENT (xmode))
  	{
  	  DECL_ALIGN (decl) = MAX (GET_MODE_ALIGNMENT (xmode),
--- 352,356 ----
  	= mode_for_size_tree (DECL_SIZE (decl), MODE_INT, 1);
  
!       if (xmode != BLKmode && known_align >= GET_MODE_ALIGNMENT (xmode))
  	{
  	  DECL_ALIGN (decl) = MAX (GET_MODE_ALIGNMENT (xmode),
*************** layout_decl (decl, known_align)
*** 364,368 ****
    if (code == FIELD_DECL && DECL_BIT_FIELD (decl)
        && TYPE_MODE (type) == BLKmode && DECL_MODE (decl) == BLKmode
!       && known_align > TYPE_ALIGN (type)
        && DECL_ALIGN (decl) >= TYPE_ALIGN (type)
        && DECL_SIZE_UNIT (decl) != 0)
--- 364,368 ----
    if (code == FIELD_DECL && DECL_BIT_FIELD (decl)
        && TYPE_MODE (type) == BLKmode && DECL_MODE (decl) == BLKmode
!       && known_align >= TYPE_ALIGN (type)
        && DECL_ALIGN (decl) >= TYPE_ALIGN (type)
        && DECL_SIZE_UNIT (decl) != 0)

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