Hi Paul,
What causes the ICES?
There were a few PRs along this line. Usually, it is the front-end pass inserting code which is illegal Fortran, and the later stages then asserting that it doesn't happen. Here are a few examples: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50690 (function elimination in OMP Workshare) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50564 (forall) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69154 (matmul in where) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69742 (in associate). If you want to do the finalization of function results via a front end pass, creating a variable and then assigning it from within these constructs can cause these kinds of problems. Best regards Thomas