Commit bf8ebcd
authored
Zero size arrays of derived type (#1050)
Fix two problems with zero size arrays with derived type elements.
The first problem occurs when the derived type element of a zero size
array has default initialization. -- fix in ConvertVariable.cpp
type dt
integer :: j = 17
end type
type(dt) :: z(0)
The second problem occurs when the derived type element of a zero size
array has an explicit, conformable, scalar initialization. That appears
to be standard conforming, if not too useful, although it has the side
affect of forcing the SAVE attribute on z. -- fix in ConvertExpr.cpp
type dt
integer :: j
end type
type(dt) :: z(0) = dt(99)
Also add a verifier for fir.insert_on_range ops, which triggers for
the first test case without the corresponding fix.1 parent fbb3d2e commit bf8ebcd
File tree
5 files changed
+88
-29
lines changed- flang
- include/flang/Optimizer/Dialect
- lib
- Lower
- Optimizer/Dialect
- test/Lower
5 files changed
+88
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2222 | 2222 | | |
2223 | 2223 | | |
2224 | 2224 | | |
2225 | | - | |
2226 | | - | |
2227 | | - | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
2228 | 2239 | | |
2229 | 2240 | | |
2230 | 2241 | | |
| |||
2238 | 2249 | | |
2239 | 2250 | | |
2240 | 2251 | | |
| 2252 | + | |
| 2253 | + | |
2241 | 2254 | | |
2242 | 2255 | | |
2243 | 2256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1100 | 1100 | | |
1101 | 1101 | | |
1102 | 1102 | | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | 1103 | | |
1112 | 1104 | | |
1113 | 1105 | | |
1114 | 1106 | | |
1115 | 1107 | | |
1116 | 1108 | | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
1117 | 1117 | | |
1118 | 1118 | | |
1119 | 1119 | | |
| |||
1169 | 1169 | | |
1170 | 1170 | | |
1171 | 1171 | | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
1172 | 1179 | | |
1173 | 1180 | | |
1174 | | - | |
1175 | 1181 | | |
1176 | | - | |
1177 | | - | |
| 1182 | + | |
| 1183 | + | |
1178 | 1184 | | |
1179 | | - | |
1180 | | - | |
1181 | | - | |
1182 | | - | |
1183 | | - | |
| 1185 | + | |
| 1186 | + | |
1184 | 1187 | | |
1185 | 1188 | | |
1186 | 1189 | | |
1187 | 1190 | | |
1188 | 1191 | | |
1189 | | - | |
1190 | | - | |
| 1192 | + | |
| 1193 | + | |
1191 | 1194 | | |
1192 | 1195 | | |
1193 | 1196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
991 | 991 | | |
992 | 992 | | |
993 | 993 | | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
994 | 1011 | | |
995 | 1012 | | |
996 | 1013 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
7 | 31 | | |
8 | 32 | | |
9 | 33 | | |
10 | 34 | | |
11 | 35 | | |
12 | 36 | | |
13 | | - | |
| 37 | + | |
14 | 38 | | |
15 | 39 | | |
16 | 40 | | |
17 | 41 | | |
18 | 42 | | |
19 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
20 | 46 | | |
0 commit comments