File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,8 @@ void ComputeOffsetsHelper::Compute(Scope &scope) {
116116 DoSymbol (*symbol);
117117 }
118118 }
119+ // Ensure that the size is a multiple of the alignment
120+ offset_ = Align (offset_, alignment_);
119121 scope.set_size (offset_);
120122 scope.SetAlignment (alignment_);
121123 // Assign offsets in COMMON blocks, unless this scope is a BLOCK construct,
Original file line number Diff line number Diff line change @@ -8,11 +8,17 @@ subroutine s1
88 real (8 ) :: a
99 real (4 ) :: b
1010 end type
11- ! CHECK: x1 size=12 offset=0:
12- ! CHECK: y1 size=12 offset=16:
11+ type t2
12+ type (t1) c
13+ real (4 ) d
14+ end type
15+ ! CHECK: x1 size=16 offset=0:
16+ ! CHECK: y1 size=16 offset=16:
1317 type (t1) :: x1, y1
1418 ! CHECK: z1 size=160 offset=32:
1519 type (t1) :: z1(10 )
20+ ! CHECK: z2 size=24 offset=192
21+ type (t2) z2
1622end
1723
1824! Like t1 but t2 does not need to be aligned on 64-bit boundary
You can’t perform that action at this time.
0 commit comments