Dear Fortranners, the PR rightfully complained that we did not differentiate errors on ALLOCATE(...,stat=,errmsg=) for failures from allocation of already allocated objects or insufficient virtual memory. The attached patch introduces a new STAT value LIBERROR_NO_MEMORY that is returned for insufficient virtual memory, and a corresponding (simple and invariant) ERRMSG: "Insufficient virtual memory". (In the PR Janne mentions checking for errno, but since the standard malloc(3) only mentions ENOMEM as possible error value, and the user may replace malloc by a special library, I believe that won't be easy to handle in a general way.) Most compilers I tried (Intel/NAG/Crayftn) behave similarly, except for Nvidia/Flang, which try to return the size of the allocation in the error message. I am not sure that this is worth the effort. First, ERRMSG is very compiler-dependent anyway and thus not really portable. If a user wants to know what the size of the failed allocation is and really wants to recover, he/she should find that out himself. Second, I think that the more important change is the introduction of a STAT value that allows the distinction between the different causes of failure. The testcase should be able to handle 32 and 64 bit systems. At least that's what I think. Regtested on x86_64-pc-linux-gnu. OK for mainline? Suggestions? Thanks, Harald