diff options
author | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-10-23 16:36:51 +0000 |
---|---|---|
committer | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-10-23 16:36:51 +0000 |
commit | 546e12a7e55a940c2d4fc314277a10ff8003ad29 (patch) | |
tree | b5a2423de4a0bde33164ad736843458ea9f47818 /gcc/stor-layout.c | |
parent | 88f9884fb160ffeab7fea3702367772f3143e12d (diff) | |
download | linaro-gcc-546e12a7e55a940c2d4fc314277a10ff8003ad29.tar.gz linaro-gcc-546e12a7e55a940c2d4fc314277a10ff8003ad29.tar.bz2 linaro-gcc-546e12a7e55a940c2d4fc314277a10ff8003ad29.zip |
2006-10-23 Paul Brook <paul@codesourcery.com>
gcc/
* stor-layout.c (start_record_layout): maximum_field_alignment
overrides STRUCTURE_SIZE_BOUNDARY.
gcc/testsuite/
* gcc.dg/pragma-pack-5.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117977 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r-- | gcc/stor-layout.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index d1e18a243d0..51db310bd48 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -531,7 +531,15 @@ start_record_layout (tree t) #ifdef STRUCTURE_SIZE_BOUNDARY /* Packed structures don't need to have minimum size. */ if (! TYPE_PACKED (t)) - rli->record_align = MAX (rli->record_align, (unsigned) STRUCTURE_SIZE_BOUNDARY); + { + unsigned tmp; + + /* #pragma pack overrides STRUCTURE_SIZE_BOUNDARY. */ + tmp = (unsigned) STRUCTURE_SIZE_BOUNDARY; + if (maximum_field_alignment != 0) + tmp = MIN (tmp, maximum_field_alignment); + rli->record_align = MAX (rli->record_align, tmp); + } #endif rli->offset = size_zero_node; |