@@ -2033,6 +2033,8 @@ ref_same_as_full_array (gfc_ref *full_ref, gfc_ref *ref)
return false;
if (ref->type != REF_ARRAY)
return false;
+ if (ref->u.ar.type == AR_FULL)
+ return true;
if (ref->u.ar.type != AR_SECTION)
return false;
new file mode 100644
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! PR 95812 - this caused an ICE.
+! Test case by Jakub Jelinek.
+
+module test
+contains
+ subroutine foo()
+ integer :: a(3)
+ a = 1
+ print *, matmul(1*reshape(a,(/3,1/)), reshape((/1,1,1/),(/1,3/)))
+ end subroutine foo
+ subroutine bar()
+ call foo()
+ end subroutine bar
+end module test