https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83633
--- Comment #4 from Nathan T. Weeks <weeks at iastate dot edu> --- Fortran 2008 appears to have tightened restrictions on explicit-shape arrays in the main program and made this particular case illegal (per section 5.3.8.2 "Explicit-shape array"): C531 (R516) An explicit-shape-spec whose bounds are not constant expressions shall appear only in a subprogram, derived type definition, BLOCK construct, or interface body.