gcc/fortran/ChangeLog:
PR fortran/104331
* simplify.cc (gfc_simplify_eoshift): Avoid NULL pointer
dereference when shape is not set.
gcc/testsuite/ChangeLog:
PR fortran/104331
* gfortran.dg/eoshift_9.f90: New test.
if (arraysize == 0)
goto final;
+ if (array->shape == NULL)
+ goto final;
+
arrayvec = XCNEWVEC (gfc_expr *, arraysize);
array_ctor = gfc_constructor_first (array->value.constructor);
for (i = 0; i < arraysize; i++)
--- /dev/null
+! { dg-do compile }
+! PR fortran/104331 - ICE in gfc_simplify_eoshift
+! Contributed by G.Steinmetz
+
+program p
+ character(3), parameter :: a(:) = ['123'] ! { dg-error "deferred shape" }
+ character(3), parameter :: b(*) = eoshift(a, 1)
+end