mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-04 09:14:04 +08:00
stor-layout.c (layout_decl): Check DECL_PACKED before calling ADJUST_FIELD_ALIGN.
* stor-layout.c (layout_decl): Check DECL_PACKED before calling ADJUST_FIELD_ALIGN. Check maximum_field_alignment after. From-SVN: r80860
This commit is contained in:
parent
c2b5e13ba5
commit
9ca75f15bc
@ -1,3 +1,8 @@
|
|||||||
|
2004-04-19 Daniel Jacobowitz <drow@mvista.com>
|
||||||
|
|
||||||
|
* stor-layout.c (layout_decl): Check DECL_PACKED before calling
|
||||||
|
ADJUST_FIELD_ALIGN. Check maximum_field_alignment after.
|
||||||
|
|
||||||
2004-04-19 Andrew PInski <pinskia@physics.uc.edu>
|
2004-04-19 Andrew PInski <pinskia@physics.uc.edu>
|
||||||
|
|
||||||
* builtins.c (fold_builtin_cabs): Remove fndecl parameter.
|
* builtins.c (fold_builtin_cabs): Remove fndecl parameter.
|
||||||
|
@ -512,10 +512,7 @@ layout_decl (tree decl, unsigned int known_align)
|
|||||||
|| TREE_CODE (DECL_SIZE_UNIT (decl)) == INTEGER_CST))
|
|| TREE_CODE (DECL_SIZE_UNIT (decl)) == INTEGER_CST))
|
||||||
DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), BITS_PER_UNIT);
|
DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), BITS_PER_UNIT);
|
||||||
|
|
||||||
/* Should this be controlled by DECL_USER_ALIGN, too? */
|
if (! DECL_USER_ALIGN (decl) && ! DECL_PACKED (decl))
|
||||||
if (maximum_field_alignment != 0)
|
|
||||||
DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), maximum_field_alignment);
|
|
||||||
if (! DECL_USER_ALIGN (decl))
|
|
||||||
{
|
{
|
||||||
/* Some targets (i.e. i386, VMS) limit struct field alignment
|
/* Some targets (i.e. i386, VMS) limit struct field alignment
|
||||||
to a lower boundary than alignment of variables unless
|
to a lower boundary than alignment of variables unless
|
||||||
@ -528,6 +525,10 @@ layout_decl (tree decl, unsigned int known_align)
|
|||||||
DECL_ALIGN (decl) = ADJUST_FIELD_ALIGN (decl, DECL_ALIGN (decl));
|
DECL_ALIGN (decl) = ADJUST_FIELD_ALIGN (decl, DECL_ALIGN (decl));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Should this be controlled by DECL_USER_ALIGN, too? */
|
||||||
|
if (maximum_field_alignment != 0)
|
||||||
|
DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), maximum_field_alignment);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Evaluate nonconstant size only once, either now or as soon as safe. */
|
/* Evaluate nonconstant size only once, either now or as soon as safe. */
|
||||||
|
Loading…
Reference in New Issue
Block a user