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) {
116
116
DoSymbol (*symbol);
117
117
}
118
118
}
119
+ // Ensure that the size is a multiple of the alignment
120
+ offset_ = Align (offset_, alignment_);
119
121
scope.set_size (offset_);
120
122
scope.SetAlignment (alignment_);
121
123
// 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
8
8
real (8 ) :: a
9
9
real (4 ) :: b
10
10
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:
13
17
type (t1) :: x1, y1
14
18
! CHECK: z1 size=160 offset=32:
15
19
type (t1) :: z1(10 )
20
+ ! CHECK: z2 size=24 offset=192
21
+ type (t2) z2
16
22
end
17
23
18
24
! 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