gcc/fortran/ChangeLog:
PR fortran/108529
* simplify.cc (simplify_transformation): Do not try to simplify
transformational intrinsic when the ARRAY argument has a NULL shape.
gcc/testsuite/ChangeLog:
PR fortran/108529
* gfortran.dg/pr108529.f90: New test.
(cherry picked from commit
6c96382eed96a9285611f2e3e2e59557094172b8)
size_zero = gfc_is_size_zero_array (array);
if (!(is_constant_array_expr (array) || size_zero)
+ || array->shape == NULL
|| !gfc_is_constant_expr (dim))
return NULL;
--- /dev/null
+! { dg-do compile }
+! PR fortran/108529 - ICE in transformational_result
+! Contributed by G.Steinmetz
+
+program p
+ integer, parameter :: a(*,*) = reshape([1, 2, 3, 4], [2, 2])
+ logical, parameter :: b(2,*) = a > 2 ! { dg-error "Assumed size" }
+ logical, parameter :: c(*) = all(b, 1) ! { dg-error "Bad shape" }
+end