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: http://gcc.gnu.org/ml/gcc-patches/2006-02/msg01762.html 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). -- Summary: Reuse I/O structures to save memory and help the ME Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34705