This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/26041] FORTRAN compiler won't compile the valid code
- From: "hjl at lucon dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Jan 2006 04:58:57 -0000
- Subject: [Bug fortran/26041] FORTRAN compiler won't compile the valid code
- References: <bug-26041-682@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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