re PR fortran/67679 (-Wunitialized reports on compiler-generated variables)

2019-02-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/67679
    * gfortran.dg/warn_undefined_1.f90: New test.

From-SVN: r268747
This commit is contained in:
Thomas Koenig 2019-02-10 15:38:19 +00:00
parent ab23d6fa98
commit 1386121ecd
2 changed files with 33 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2019-02-10 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/67679
* gfortran.dg/warn_undefined_1.f90: New test.
2019-02-10 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/89268

View file

@ -0,0 +1,28 @@
! { dg-do compile }
! { dg-options "-O2 -Wuninitialized" }
! PR 67679 - this used to cause an undefined warning for
! variables generated by the compiler.
subroutine s(h, Gmin, r)
implicit none
real, intent(in) :: Gmin(3), h(3)
integer, intent(inout) :: r
integer :: x_min(3), x_max(3), k, iStat
logical, dimension(:), allocatable :: check
do k = 1,1
x_min(k) = int(Gmin(k)*h(k))
x_max(k) = int(Gmin(k)*h(k))
end do
allocate(check(x_min(1):x_max(1)),stat=iStat)
check(:) = .false.
do k = x_min(1),x_max(1)
r = r + 1
end do
end