https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68566
--- Comment #6 from Harald Anlauf <anlauf at gmx dot de> --- (In reply to Harald Anlauf from comment #5) The patch in comment #5 regtests without new failures. It appears that a testcase based on comment #4 is sufficient: Index: gcc/testsuite/gfortran.dg/pr68566.f90 =================================================================== --- gcc/testsuite/gfortran.dg/pr68566.f90 (revision 0) +++ gcc/testsuite/gfortran.dg/pr68566.f90 (revision 0) @@ -0,0 +1,8 @@ +! { dg-do compile } +! PR fortran/68566 - ICE on using unusable array in reshape +! Testcase by Gerhard Steinmetz <gerhard.steinmetz.fortran at t-online.de> + +program p + integer, parameter :: a(:) = 1 ! { dg-error "or of deferred shape" } + integer, parameter :: b(2,2) = reshape([a], [2,2]) +end