On 9/20/25 1:34 PM, Harald Anlauf wrote:
Dear All,
the attached patch is the result of several long debugging sessions
trying to find out why deferred-length character arrays were mistreated.
It turned out that when deriving the dataptr offset in the array
descriptor, for fixed length the element size takes into account the
known string length, while for deferred-length it is taken from the
underlying type. We thus need to fix that and multiply the offset by
the length.
While developing the testcase, I noticed that not only write statements
are affected by this issue as in the original PR, but also pointer
association. I thus tried to exercise positive and negative and
non-unit strides.
Testcase cross-checked with NAG. And it runs clean under valgrind. ;-)
Regtested on x86_64-pc-linux-gnu. OK for mainline?
And if it survives for some time, backport to 15-branch?
Thanks,
Harald
Yes, OK for mainline and backport as you see.
Jerry