Commit cfcafcf
committed
[flang] Use box for components with non-default lower bounds
When designating an array component that has non-default lower bounds
the bridge was producing hlfir designates yielding reference types, which
did not preserve the bounds information. Then, when creating components,
the correct indices were not used when initializing a structure.
We could look at the declaration to get the shape parameter, but this
would not be preserved if the component were passed as a block argument.
These results must be boxed, but we also must not lose the contiguity
information either. To address contiguity, annotate these boxes with the
`contiguous` attribute during designation.
Note that other desgnated entities are handled inside the
HlfirDesignatorBuilder while component designators are built in
HlfirBuilder. I am not sure if this handling should be moved into the
designator builder or left in the general builder.1 parent 368fbc2 commit cfcafcf
File tree
2 files changed
+29
-3
lines changed- flang
- lib/Lower
- test/Lower/HLFIR
2 files changed
+29
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
128 | 142 | | |
129 | 143 | | |
130 | 144 | | |
| |||
1863 | 1877 | | |
1864 | 1878 | | |
1865 | 1879 | | |
1866 | | - | |
1867 | | - | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
1868 | 1883 | | |
1869 | 1884 | | |
1870 | 1885 | | |
| |||
1884 | 1899 | | |
1885 | 1900 | | |
1886 | 1901 | | |
1887 | | - | |
| 1902 | + | |
| 1903 | + | |
1888 | 1904 | | |
1889 | 1905 | | |
1890 | 1906 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
129 | 139 | | |
130 | 140 | | |
131 | 141 | | |
| |||
0 commit comments