Sandra Loosemore wrote:
When computing the start of the map range, extract_base_bit_offset was
already replacing references to iterator variables with their low
bound. This needs to be done also when computing the offset of
sibling struct members relative to the one with the lowest start
address; otherwise iterator variables from one loop can end up in the
offset expression for a member mapped with a different set of
iterators.
LGTM – but I hope you have somewhere in a later patch in the series a
testcase for this fix, if not, adding one would be good.
Thanks,
Tobias
gcc/ChangeLog
* gimplify.cc (replace_iterators_with_start): New function, split
from...
(extract_base_bit_offset): ...here.
(omp_build_struct_sibling_lists): Consolidate code between the "then"
and "else" branches. Call the new function on the address
expressions so that the new bias will be relative to the start
address.