Commit 31cd32b
committed
[flang] Improve runtime SAME_TYPE_AS()
The present implementation of the intrinsic function SAME_TYPE_AS()
yields false positive .TRUE. results for distinct derived types that
happen to have the same name.
Replace with an implementation that can now depend on derived type
information records being the same type if and only if they are at
the same location, or are PDT instantiations of the same uninstantiated
derived type. And ensure that the derived type information includes
references from instantiated PDTs to their original types.
(The derived type information format supports these references already,
but they were not being set, perhaps because the current faulty
SAME_TYPE_AS implementation didn't need them, and nothing else does.)
Fixes #135580.1 parent 9f7aac1 commit 31cd32b
File tree
4 files changed
+35
-47
lines changed- flang-rt
- include/flang-rt/runtime
- lib/runtime
- flang
- lib/Semantics
- test/Semantics
4 files changed
+35
-47
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
216 | 220 | | |
217 | 221 | | |
218 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | 86 | | |
108 | 87 | | |
109 | 88 | | |
| |||
121 | 100 | | |
122 | 101 | | |
123 | 102 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
138 | 115 | | |
139 | 116 | | |
| 117 | + | |
140 | 118 | | |
141 | 119 | | |
142 | 120 | | |
| |||
155 | 133 | | |
156 | 134 | | |
157 | 135 | | |
158 | | - | |
| 136 | + | |
159 | 137 | | |
160 | 138 | | |
161 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
| 313 | + | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
| 316 | + | |
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
| 398 | + | |
| 399 | + | |
399 | 400 | | |
400 | 401 | | |
401 | 402 | | |
| |||
449 | 450 | | |
450 | 451 | | |
451 | 452 | | |
452 | | - | |
| 453 | + | |
453 | 454 | | |
454 | 455 | | |
455 | 456 | | |
| |||
480 | 481 | | |
481 | 482 | | |
482 | 483 | | |
483 | | - | |
| 484 | + | |
| 485 | + | |
484 | 486 | | |
485 | 487 | | |
486 | 488 | | |
| |||
516 | 518 | | |
517 | 519 | | |
518 | 520 | | |
519 | | - | |
| 521 | + | |
| 522 | + | |
520 | 523 | | |
521 | 524 | | |
522 | 525 | | |
| |||
804 | 807 | | |
805 | 808 | | |
806 | 809 | | |
807 | | - | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
808 | 813 | | |
809 | 814 | | |
810 | 815 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
0 commit comments