https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83149
--- Comment #5 from Neil Carlson <neil.n.carlson at gmail dot com> --- I disagree (in part) with comment 4. Ncells is a valid specification statement (see 7.1.11, par 2 (4), Fortran 2008). Its value need not be known at compile time; only when the get() function is executed. If the code successfully compiled then, yes, at run time it is not conforming because ncells was never assigned a value. Interestingly if the main program is modified to use mod1 (but still not define ncells) then the ICE goes away. use mod1 use mod2 s = sum(get()) end So perhaps there is something here about mod1 going out of scope. I forget how that works, and seem to recall that some new standard was going to drop that feature of the language. However that aspect can be side stepped by just turning the main program into a subprogram subroutine sub use mod2 s = sum(get()) end This still gives an ICE and I believe is valid. Both NAG and Intel compile without error, fwtw.