It seems the patch for PR fortran/83633 cured
PR fortran/64107.  I've added the code from
this PR to the test suite to ensure that it
doesn't get broken.  Patche attached.

2018-03-06  Steven G. Kargl  <ka...@gcc.gnu.org>

        PR fortran/64107
        * gfortran.dg/pr64107.f90: New test.

-- 
Steve
Index: gcc/testsuite/gfortran.dg/pr64107.f90
===================================================================
--- gcc/testsuite/gfortran.dg/pr64107.f90       (nonexistent)
+++ gcc/testsuite/gfortran.dg/pr64107.f90       (working copy)
@@ -0,0 +1,30 @@
+! { dg-do compile }
+! PR fortran/64107
+! Code contribute by  fxcoudert at gcc dot gnu dot org
+! Appears to be fixed by patch for PR fortran/83633
+module m1
+
+contains
+  pure integer function foo()
+    foo = 2
+  end function
+end module
+
+subroutine test
+  use m1
+  integer :: x1(foo())
+end subroutine
+
+module m
+  use m1
+  integer :: x2(foo())     ! { dg-error "array with nonconstant bounds" }
+contains
+  subroutine sub
+    integer :: x3(foo())
+  end subroutine
+end module
+
+program p
+  use m1
+  integer :: x4(foo())     ! { dg-error "array with nonconstant bounds" }
+end program

Reply via email to