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/26041] FORTRAN compiler won't compile the valid code



------- Comment #2 from hjl at lucon dot org  2006-01-31 04:58 -------
How about this?

[hjl@gnu-16 cpu2006-465b]$ !cat
cat foo.f90
module foo
   public    bar_
   interface bar_
      module procedure bar
   end interface
   public    xxx_
   interface xxx_
      module procedure xxx
   end interface
contains
   subroutine bar(self, z)
      interface
         function self(z) result(res)
            real z
            real(kind=kind(1.0d0)) :: res
         end function
      end interface
   end subroutine
   subroutine xxx(self,z)
      interface
         function self(z) result(res)
            real z
            real(kind=kind(1.0d0)) :: res
         end function
      end interface
      call bar_(self, z)
   end subroutine
end
[hjl@gnu-16 cpu2006-465b]$ make
/export/build/gnu/gcc/build-x86_64-linux/gcc/gfortran
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -O2 -S foo.f90
 In file foo.f90:26

      call bar_(self, z)
                       1
Error: Generic subroutine 'bar_' at (1) is not an intrinsic subroutine
make: *** [foo.s] Error 1
[hjl@gnu-16 cpu2006-465b]$

If I swap the order of xxx and bar, it compiles:

[hjl@gnu-16 cpu2006-465b]$ !cat
cat foo.f90
module foo
   public    bar_
   interface bar_
      module procedure bar
   end interface
   public    xxx_
   interface xxx_
      module procedure xxx
   end interface
contains
   subroutine xxx(self,z)
      interface
         function self(z) result(res)
            real z
            real(kind=kind(1.0d0)) :: res
         end function
      end interface
      call bar_(self, z)
   end subroutine
   subroutine bar(self, z)
      interface
         function self(z) result(res)
            real z
            real(kind=kind(1.0d0)) :: res
         end function
      end interface
   end subroutine
end
[hjl@gnu-16 cpu2006-465b]$ make
/export/build/gnu/gcc/build-x86_64-linux/gcc/gfortran
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -O2 -S foo.f90
[hjl@gnu-16 cpu2006-465b]$


-- 


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


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