Commit ec6b2c6
authored
[flang] Fold character array constructor with unknown length (#123983)
When a character array constructor does not have an explicit type with a
constant length, the compiler can still fold it if all of its elements
are constants. These array constructors will have been wrapped up in the
internal %SET_LENGTH operation, which will determine the final length of
the folded value, so use the maximum length of the constant elements as
the length of the folded array constructor.
Fixes #123766.1 parent f5ddb10 commit ec6b2c6
File tree
2 files changed
+21
-6
lines changed- flang
- lib/Evaluate
- test/Evaluate
2 files changed
+21
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1267 | 1267 | | |
1268 | 1268 | | |
1269 | 1269 | | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
1270 | 1276 | | |
1271 | 1277 | | |
1272 | 1278 | | |
1273 | 1279 | | |
1274 | 1280 | | |
1275 | 1281 | | |
1276 | 1282 | | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
1283 | 1286 | | |
1284 | 1287 | | |
1285 | 1288 | | |
| |||
1300 | 1303 | | |
1301 | 1304 | | |
1302 | 1305 | | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
1303 | 1311 | | |
1304 | 1312 | | |
1305 | 1313 | | |
| |||
1349 | 1357 | | |
1350 | 1358 | | |
1351 | 1359 | | |
| 1360 | + | |
| 1361 | + | |
1352 | 1362 | | |
1353 | 1363 | | |
1354 | 1364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments