aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@mvista.com>2004-04-19 18:02:40 +0000
committerDaniel Jacobowitz <drow@gcc.gnu.org>2004-04-19 18:02:40 +0000
commit9ca75f15bc838ca74422a37533324d464e1c72f7 (patch)
tree8ce7d356ff28ad832d653e593d6bfa7a3a05ebc3
parentc2b5e13ba5e3d5dbd7cf0e43a529ca3f7bc40518 (diff)
downloadgcc-9ca75f15bc838ca74422a37533324d464e1c72f7.zip
gcc-9ca75f15bc838ca74422a37533324d464e1c72f7.tar.gz
gcc-9ca75f15bc838ca74422a37533324d464e1c72f7.tar.bz2
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
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/stor-layout.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3bd73fe..198314a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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>
* builtins.c (fold_builtin_cabs): Remove fndecl parameter.
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index d19fc9f..33d0a86 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -512,10 +512,7 @@ layout_decl (tree decl, unsigned int known_align)
|| TREE_CODE (DECL_SIZE_UNIT (decl)) == INTEGER_CST))
DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), BITS_PER_UNIT);
- /* Should this be controlled by DECL_USER_ALIGN, too? */
- if (maximum_field_alignment != 0)
- DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), maximum_field_alignment);
- if (! DECL_USER_ALIGN (decl))
+ if (! DECL_USER_ALIGN (decl) && ! DECL_PACKED (decl))
{
/* Some targets (i.e. i386, VMS) limit struct field alignment
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));
#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. */