This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/32488] New: Enless compile-time loop due to cyclic definitions


The following program causes an endless loop in gfortran.

I'm not 100% sure that it is invalid though I think it is.

- NAG f95 accepts the program and prints: ""
- g95: Error: Circular specification in variable 'ouch' at (1)
- ifort:
fortcom: Error: cyclic_specs1.f90, line 10: Conflicting attributes or multiple
declaration of name.   [OUCH]
         implicit character(len(ouch)) (x)
--------------------------------^
- sunf95: ICE
- Lahey:
 Module subprogram name(ouch)
  2030-S: "SOURCE.F90", line 8: Type parameters or bounds of variable 'ouch'
cannot be inquired.
  2030-S: "SOURCE.F90", line 9: Type parameters or bounds of variable 'x'
cannot be inquired.


! http://home.comcast.net/~kmbtib/
! File: cyclic_specs1.f90
! Public domain 2004 James Van Buskirk
module cyclic
   implicit none
   contains
      function ouch(x,y)
         implicit character(len(ouch)) (x)
         implicit character(len(x)+1) (y)
         implicit character(len(y)-1) (o)
         intent(in) x,y
         character(len(y)-1) ouch
         integer i
         do i = 1, len(ouch)
            ouch(i:i) = achar(ieor(iachar(x(i:i)),iachar(y(i:i))))
         end do
      end function ouch
end module cyclic

program test
   use cyclic
   implicit none
   write(*,*) ouch('YOW!','     ')
end program test


-- 
           Summary: Enless compile-time loop due to cyclic definitions
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]