summaryrefslogtreecommitdiff
path: root/gcc/tree-nested.c
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-18 23:43:23 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-18 23:43:23 +0000
commitbeebc64a4e93e7006a311696b6373873598f080b (patch)
tree4483353c2c7f7a20740bbd95d2b06188cd9bc909 /gcc/tree-nested.c
parent06fe80700b53dd9bd86edba4f8578af2256e621d (diff)
downloadgcc-beebc64a4e93e7006a311696b6373873598f080b.tar.gz
gcc/
2008-02-18 Joey Ye <joey.ye@intel.com> PR middle-end/34921 * tree-nested.c (insert_field_into_struct): Set type alignment to field alignment if the former is less than the latter. gcc/testsuite/ 2008-02-18 Joey Ye <joey.ye@intel.com> H.J. Lu <hongjiu.lu@intel.com> PR middle-end/34921 * gcc.c-torture/execute/nest-align-1.c: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132396 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-nested.c')
-rw-r--r--gcc/tree-nested.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index a20e320ad2e..2c1b9190d85 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -183,6 +183,10 @@ insert_field_into_struct (tree type, tree field)
TREE_CHAIN (field) = *p;
*p = field;
+
+ /* Set correct alignment for frame struct type. */
+ if (TYPE_ALIGN (type) < DECL_ALIGN (field))
+ TYPE_ALIGN (type) = DECL_ALIGN (field);
}
/* Build or return the RECORD_TYPE that describes the frame state that is