https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121805
--- Comment #7 from Mikael Morin <mikael at gcc dot gnu.org> --- (In reply to federico from comment #5) > > from my limited understanding the array version does not have a `dd.offset + > ` term that was set as `dd.offset = -1;`, This is expected. offset is used for user indexing, but not for compiler generated indexing. Its value is -(sum_i lbound(i)*stride(i)), so that when a user accesses array(lbound(1), ..., lbound(n)) one gets a zero offset, and it accesses array[0]. > but also the loop address is > multiplied `*4` in the array version but `*dd.span` in the loop version (is > that because the loop variable is 8-byte vs. 4-byte perhaps?) No, it's not for the loop variable. The index is multiplied by the stride (number of elements between consecutive indexes) and by the size of an array element, which is the size of an element of e, which is the size of str: 4+1 bytes aligned on 4 bytes boundaries, that makes 8 bytes. That's where it gets tricky. The array element size is taken from the type of the original array (e), not from the type of the pointer (dd). The value of 4 is unexpected, I suspect that's (part of?) the bug.