Based on PR 34683.
Richard writes there (text below slightly edited by me):
So, to sum up, the situation could be significantly improved by improving
the FE. Like I noticed for I/O statements, where I provided a patch -
that was not accepted - to share temporary variables created for the I/O
context. Which is this one:
basically it mentiones async I/O as a reason to not do it, but instead the
callee can copy the I/O structure in that case instead (it probably needs
to anyway, as currently those structures live on the stack, so with async
I/O you'd need otherwise to guarantee that the I/O finished before the
current frame is left).
So, currently you can build up arbitrary large chains of virtual clobbers with WRITE statements; as each of those writes create two un-partitionable SFTs. For arrays temporaries this is the same. Actually it isn't that bad for I/O as long as there are no pointers to the dt_parm structs in the IL (function arguments are ok).