Bug 35234

Summary: Undetected "use before definition".
Product: gcc Reporter: Dominique d'Humieres <dominiq>
Component: fortranAssignee: Not yet assigned to anyone <unassigned>
Status: NEW ---    
Severity: enhancement CC: dominiq, gcc-bugs, manu, P.Schaffnit
Priority: P3 Keywords: diagnostic
Version: 4.3.0   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2015-08-12 00:00:00

Description Dominique d'Humieres 2008-02-17 15:44:32 UTC
In the code from

http://groups.google.fr/group/comp.lang.fortran/browse_thread/thread/120303aae031b672/7dd83bc30a9f19a3#7dd83bc30a9f19a3

gfortran detect the problems coming from the undefined 'j', but not the fact that 'df4_dxi'  is used before it is defined.  Am I missing a relevant option or is it a missing feature/bug in gfortran/gcc?
Comment 1 Dominique d'Humieres 2008-03-16 13:46:39 UTC
Reduced test case:

      program prandtl meyer 
      implicit none 
      integer :: i, j 
      integer, parameter :: imax = 100 
      integer, parameter :: jmax =  40 
      real, dimension(0:jmax,0:imax) :: f1, f1_bar
      do i = 0, imax-1 
         do j = 1, jmax-1 
            f1_bar(j,i+1) = f1(j,i)
         end do 
      end do 
      stop 
      end program prandtl meyer 

[ibook-dhum] f90/bug% gfc -O -Wuninitialized -Wall timing/prandtl_red.f
[ibook-dhum] f90/bug%

I think it is a duplicate of PR27120.

Comment 2 Francois-Xavier Coudert 2009-03-28 13:39:48 UTC
It's indeed a duplicate of 27120.

*** This bug has been marked as a duplicate of 27120 ***
Comment 3 Manuel López-Ibáñez 2015-08-12 14:28:24 UTC
(In reply to Francois-Xavier Coudert from comment #2)
> It's indeed a duplicate of 27120.

It seems it wasn't.