https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68927
--- Comment #1 from Bill Long <longb at cray dot com> --- The DEALLOCATE statement in subroutine SUB is attempting to deallocate a static array with the SAVE attribute. The standard requires that a non-zero status be returned in cases like this, and execution continues without deallocating the offending array. In para 1 of 6.7.3.3 Deallocation of pointer targets, "Deallocating a pointer that is disassociated or whose target was not created by an ALLOCATE statement causes an error condition in the DEALLOCATE statement." Hence in this case, an error condition occurs. In para 3 of 6.7.4 STAT= specifier: "If any other error condition occurs during execution of the ALLOCATE or DEALLOCATE statement, the stat-variable becomes defined with a processor-dependent positive integer value different from STAT_STOPPED_IMAGE." Hence the value of IS is required to be non-zero. Error termination (crashing) is allowed only of STAT= is not specified. Example of expected behavior: > ftn test.f90 > ./a.out deallocate status: 4412