The following code:

subroutine cycle
  implicit none
  integer :: nsos, isym, nsym = 10
  integer :: norb(10)
  isym_: do isym = 1, nsym 
     nsos = norb(isym)
     if (nsos==0) cycle isym_
  enddo isym_
end subroutine


causes this compile time error:

     if (nsos==0) cycle isym_
                      1
Error: Expected VARIABLE at (1)


The confusion seems to arise because the subroutine is called 'cycle'. Other
compilers do handle this correctly.


-- 
           Summary: gfortran confuses 'cycle' keyword for subroutine call in
                    subroutine called 'cycle'
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: drewmccormack at mac dot com
 GCC build triplet: gcc version 4.2.0 20060805 (experimental)
GCC target triplet: powerpc-apple-darwin8.7.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28874

Reply via email to