This patch cleans up the ABI mess, I created at some point. The initial version of _gfortran_caf_register didn't handle stat/errmsg as one could leave it to the front end: The the returned memory is NULL, it's an error. However, as Nick pointed out, for stat= one can also return STAT_STOPPED_IMAGE. In order to handle this, one needs an additional argument. That's what was done - albeit incompletely: The documentation was updated, cf. http://gcc.gnu.org/wiki/CoarrayLib#Registering_coarrays, as was the front end (cf. function declaration and call in trans-decl.c); however, the library itself (single.c and mpi.c) was not accepting the new arguments. The attached patch solves this: It updates the just (by Daniel) added trans.c call and implements the new arguments in the library. TODO: In trans.c (for the ALLOCATE statement), I currently pass NULL pointers for stat and errormsg argument. Hence, the ABI is fixed, but the error diagnostic is not yet standard conform. However, I think one can defer this to another patch. I added a note in my BUG file to make sure it won't get forgotten. Cf. http://users.physik.fu-berlin.de/~tburnus/coarray/BUGS.txt Build and regtested on x86-64-linux. OK for the trunk? (Daniel Carrera, I would be happy if you could also have a look at the patch.) Tobias