http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59345
Bug ID: 59345 Summary: _gfortran_internal_pack on compiler generated temps Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: Joost.VandeVondele at mat dot ethz.ch There is a missed optimization on compiler generated temporaries. Basically: SUBROUTINE S1(A) REAL :: A(3) CALL S2(-A) END SUBROUTINE leads to an optimized tree that contains calls to _gfortran_internal_pack _gfortran_internal_unpack __builtin_free which should not be needed as generated temps are known to be contiguous (in particular in this case, where it is generated on the stack). This would help to fully resolve PR38318 .