public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/18108] New: [gfortran] overloading does not work for functions
@ 2004-10-22  8:46 martin at mpa-garching dot mpg dot de
  2004-10-22  8:47 ` [Bug fortran/18108] " martin at mpa-garching dot mpg dot de
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: martin at mpa-garching dot mpg dot de @ 2004-10-22  8:46 UTC (permalink / raw)
  To: gcc-bugs

The current gfortran rejects the following code:

module foo
implicit none

interface bar
  module procedure bar1, bar2
end interface

contains

function bar1 (arg)
  integer arg
  logical bar1

  bar1 = (arg==0)
end function

function bar2 (arg)
  real arg
  logical bar2

  bar2 = (arg==0)
end function

subroutine baz
  logical l

  l = bar (3)
end subroutine

end module foo


~/tmp>gfortran -v gfbug.f90 
Driving: gfortran -v gfbug.f90 -lgfortranbegin -lgfortran -lm -shared-libgcc
Reading specs from /afs/mpa/data/martin/ugcc/lib/gcc/i686-pc-linux-gnu/4.0.0/specs
Configured with: /scratch/gcc/configure --quiet
--prefix=/afs/mpa/data/martin/ugcc --enable-languages=c++,f95
--with-gmp=/afs/mpa/data/martin/mygmp
Thread model: posix
gcc version 4.0.0 20041021 (experimental)
 /afs/mpa/data/martin/ugcc/libexec/gcc/i686-pc-linux-gnu/4.0.0/f951 gfbug.f90
-quiet -dumpbase gfbug.f90 -mtune=pentiumpro -auxbase gfbug -version -o
/tmp/ccTKCcxy.s
GNU F95 version 4.0.0 20041021 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.0.0 20041021 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
 In file gfbug.f90:27

  l = bar (3)
        1
Error: Symbol 'bar' at (1) has no IMPLICIT type

In principle gfortran should be able to choose the correct variant of "bar"
with the information it has. All other compilers I tried (ifc, NAG, xlf95)
accept this code.

-- 
           Summary: [gfortran] overloading does not work for functions
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: martin at mpa-garching dot mpg dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
@ 2004-10-22  8:47 ` martin at mpa-garching dot mpg dot de
  2004-10-29  8:13 ` c dot lemmen at fz-juelich dot de
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: martin at mpa-garching dot mpg dot de @ 2004-10-22  8:47 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
      Known to fail|                            |4.0.0


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
  2004-10-22  8:47 ` [Bug fortran/18108] " martin at mpa-garching dot mpg dot de
@ 2004-10-29  8:13 ` c dot lemmen at fz-juelich dot de
  2004-11-11 11:44 ` c dot lemmen at fz-juelich dot de
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: c dot lemmen at fz-juelich dot de @ 2004-10-29  8:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From c dot lemmen at fz-juelich dot de  2004-10-29 08:13 -------
Further reduced, same error:


module foo
implicit none

interface bar
  module procedure bar_real
end interface

contains

function bar_real (rarg)
  real rarg
  logical bar_real
  bar_real = (rarg==0.0)
end function

subroutine baz
  logical l
  l = bar (3.0)
end subroutine

end module foo


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
  2004-10-22  8:47 ` [Bug fortran/18108] " martin at mpa-garching dot mpg dot de
  2004-10-29  8:13 ` c dot lemmen at fz-juelich dot de
@ 2004-11-11 11:44 ` c dot lemmen at fz-juelich dot de
  2004-11-12 10:40 ` martin at mpa-garching dot mpg dot de
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: c dot lemmen at fz-juelich dot de @ 2004-11-11 11:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From c dot lemmen at fz-juelich dot de  2004-11-11 11:44 -------
Surprisingly (to me), adding a second call to the function resolves the problem,
i.e. in the examples below the following code works

subroutine baz
  logical l
  l = bar (3)
  l = bar (3)   ! alternatively, call l=bar(3.0)
end subroutine

Commenting out either of the calls to bar results in the code rejection

-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (2 preceding siblings ...)
  2004-11-11 11:44 ` c dot lemmen at fz-juelich dot de
@ 2004-11-12 10:40 ` martin at mpa-garching dot mpg dot de
  2004-11-26 13:33 ` martin at mpa-garching dot mpg dot de
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: martin at mpa-garching dot mpg dot de @ 2004-11-12 10:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From martin at mpa-garching dot mpg dot de  2004-11-12 10:40 -------
Could one of the bug masters please confirm this bug, to put it on the radar of
the Fortran developers?

Thanks,
  Martin


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (3 preceding siblings ...)
  2004-11-12 10:40 ` martin at mpa-garching dot mpg dot de
@ 2004-11-26 13:33 ` martin at mpa-garching dot mpg dot de
  2004-11-26 14:40 ` bdavis at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: martin at mpa-garching dot mpg dot de @ 2004-11-26 13:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From martin at mpa-garching dot mpg dot de  2004-11-26 13:33 -------
Created an attachment (id=7613)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7613&action=view)
a test case for the problem


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (4 preceding siblings ...)
  2004-11-26 13:33 ` martin at mpa-garching dot mpg dot de
@ 2004-11-26 14:40 ` bdavis at gcc dot gnu dot org
  2004-11-30 15:21 ` tobi at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: bdavis at gcc dot gnu dot org @ 2004-11-26 14:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bdavis at gcc dot gnu dot org  2004-11-26 14:40 -------
confirmed.

[bdavis@localhost pr18398]$ gfc z.f90
 In file z.f90:27
 
  l = bar (3)
        1
Error: Symbol 'bar' at (1) has no IMPLICIT type
[bdavis@localhost pr18398]$ gfc --version
GNU Fortran 95 (GCC 4.0.0 20041124 (experimental))


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-11-26 14:40:11
               date|                            |


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (5 preceding siblings ...)
  2004-11-26 14:40 ` bdavis at gcc dot gnu dot org
@ 2004-11-30 15:21 ` tobi at gcc dot gnu dot org
  2004-11-30 15:22 ` tobi at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-11-30 15:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-11-30 15:21 -------
(In reply to comment #2)
> Surprisingly (to me), adding a second call to the function resolves the problem,
> i.e. in the examples below the following code works
> 
> subroutine baz
>   logical l
>   l = bar (3)
>   l = bar (3)   ! alternatively, call l=bar(3.0)
> end subroutine
> 
I verified that it actually calls the right routine under these circumstances.
>From the compiler output with -fump-parse-tree:
      ASSIGN l bar_real[[((3.0000000))]]
      ASSIGN l bar_real[[((3.0000000))]]

Weird.
> Commenting out either of the calls to bar results in the code rejection



-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (6 preceding siblings ...)
  2004-11-30 15:21 ` tobi at gcc dot gnu dot org
@ 2004-11-30 15:22 ` tobi at gcc dot gnu dot org
  2005-01-11  0:17 ` steven at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-11-30 15:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-11-30 15:22 -------
I meant -fdump-parse-tree

-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (7 preceding siblings ...)
  2004-11-30 15:22 ` tobi at gcc dot gnu dot org
@ 2005-01-11  0:17 ` steven at gcc dot gnu dot org
  2005-05-05 16:40 ` pinskia at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-01-11  0:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2005-01-11 00:17 -------
*** Bug 19359 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |steven at gcc dot gnu dot
                   |                            |org


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (8 preceding siblings ...)
  2005-01-11  0:17 ` steven at gcc dot gnu dot org
@ 2005-05-05 16:40 ` pinskia at gcc dot gnu dot org
  2005-06-08  8:57 ` c dot lemmen at fz-juelich dot de
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-05 16:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-05 16:40 -------
*** Bug 21401 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |klra67 at freenet dot de


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (9 preceding siblings ...)
  2005-05-05 16:40 ` pinskia at gcc dot gnu dot org
@ 2005-06-08  8:57 ` c dot lemmen at fz-juelich dot de
  2005-06-08  9:02 ` martin at mpa-garching dot mpg dot de
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: c dot lemmen at fz-juelich dot de @ 2005-06-08  8:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From c dot lemmen at fz-juelich dot de  2005-06-08 08:57 -------
> > Surprisingly (to me), adding a second call to the function resolves the problem,
> > i.e. in the examples below the following code works
> > 
> > subroutine baz
> >   logical l
> >   l = bar (3)
> >   l = bar (3)   ! alternatively, call l=bar(3.0)
> > end subroutine
> > 
> I verified that it actually calls the right routine under these circumstances.
> From the compiler output with -fump-parse-tree:
>       ASSIGN l bar_real[[((3.0000000))]]
>       ASSIGN l bar_real[[((3.0000000))]]
> 

Does this mean that calling twice is a verified workaround solution?  Should I
have confidence in the results of this workaround?

-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (10 preceding siblings ...)
  2005-06-08  8:57 ` c dot lemmen at fz-juelich dot de
@ 2005-06-08  9:02 ` martin at mpa-garching dot mpg dot de
  2005-06-08 10:20 ` c dot lemmen at fz-juelich dot de
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: martin at mpa-garching dot mpg dot de @ 2005-06-08  9:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From martin at mpa-garching dot mpg dot de  2005-06-08 09:02 -------
(In reply to comment #10)

> Does this mean that calling twice is a verified workaround solution?  Should I
> have confidence in the results of this workaround?

Even if it was, this is not a practical solution in for large code bases like
the one I have to maintain.
What's worrying me most is that nobody appears to understand what's going wrong.
(And that for a very long time now.)

Since half a year, this is the one bug preventing me from using gfortran to
compile my code base and report more bugs :(


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (11 preceding siblings ...)
  2005-06-08  9:02 ` martin at mpa-garching dot mpg dot de
@ 2005-06-08 10:20 ` c dot lemmen at fz-juelich dot de
  2005-06-08 11:28 ` c dot lemmen at fz-juelich dot de
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: c dot lemmen at fz-juelich dot de @ 2005-06-08 10:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From c dot lemmen at fz-juelich dot de  2005-06-08 10:20 -------
Subject: Re:  [gfortran] overloading does not work for
 functions

martin at mpa-garching dot mpg dot de wrote:
> ------- Additional Comments From martin at mpa-garching dot mpg dot de  2005-06-08 09:02 -------
> (In reply to comment #10)
> 
> Even if it was, this is not a practical solution in for large code bases like
> the one I have to maintain.
> What's worrying me most is that nobody appears to understand what's going wrong.
> (And that for a very long time now.)
> 
> Since half a year, this is the one bug preventing me from using gfortran to
> compile my code base and report more bugs :(

Not practical...yeah.  I'm only beginning to see the effort of doubling 
all statements of calls to generic functions in my (rather large) 
codebase...
For the part that I implemented, everything seems to work fine, large 
parts of the code now compile and those that don't give rise to more bug 
reports.



-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (12 preceding siblings ...)
  2005-06-08 10:20 ` c dot lemmen at fz-juelich dot de
@ 2005-06-08 11:28 ` c dot lemmen at fz-juelich dot de
  2005-06-09 10:16 ` martin at mpa-garching dot mpg dot de
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: c dot lemmen at fz-juelich dot de @ 2005-06-08 11:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From c dot lemmen at fz-juelich dot de  2005-06-08 11:28 -------
Subject: Re:  [gfortran] overloading does not work for
 functions

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lots of previously working code (somewhere around December 2004) now
(June 2005) exhibits this bug, it seems that this bug is a side-effect
of something else.  Call it a regression ?

Sorry for not being able to pin down when this regression occurred.

Cheers,
CL
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFCptZP9OR+vL2Y8M8RAkBbAJ9CvatWfbsWC7evKqM2NVpLGjYGmQCfb5LQ
tjBco+Njl2ax7EXyXWwxzFA=
=KDzi
-----END PGP SIGNATURE-----



-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (13 preceding siblings ...)
  2005-06-08 11:28 ` c dot lemmen at fz-juelich dot de
@ 2005-06-09 10:16 ` martin at mpa-garching dot mpg dot de
  2005-06-13 14:13 ` david dot c dot gregory at gmail dot com
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: martin at mpa-garching dot mpg dot de @ 2005-06-09 10:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From martin at mpa-garching dot mpg dot de  2005-06-09 10:16 -------
> Lots of previously working code (somewhere around December 2004) now
> (June 2005) exhibits this bug, it seems that this bug is a side-effect
> of something else.  Call it a regression ?
> 
> Sorry for not being able to pin down when this regression occurred.

If you have a test case that compiled properly in Dec 2004, it should be
easy to locate the offending commit via the automated regression hunter,
at least for someone familiar with this tool (i.e. not me).
This could provide very important information for fixing this bug.

Could you please provide a test case and a date when you last saw this testcase
compile properly?


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (14 preceding siblings ...)
  2005-06-09 10:16 ` martin at mpa-garching dot mpg dot de
@ 2005-06-13 14:13 ` david dot c dot gregory at gmail dot com
  2005-07-07 22:38 ` steven at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: david dot c dot gregory at gmail dot com @ 2005-06-13 14:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From david dot c dot gregory at gmail dot com  2005-06-13 14:13 -------
I too would happily test gfortran, if this bug were resolved.  However, my
code-base makes heavy use of function overloading at a core level.  Thus until
this bug is fixed, the compiler is all but useless to me.   

Consider this a begging plea for one of the developers to take up this bug!!!

(In reply to comment #0)
> The current gfortran rejects the following code:
> 
> module foo
> implicit none
> 
> interface bar
>   module procedure bar1, bar2
> end interface
> 
> contains
> 
> function bar1 (arg)
>   integer arg
>   logical bar1
> 
>   bar1 = (arg==0)
> end function
> 
> function bar2 (arg)
>   real arg
>   logical bar2
> 
>   bar2 = (arg==0)
> end function
> 
> subroutine baz
>   logical l
> 
>   l = bar (3)
> end subroutine
> 
> end module foo
> 
> 
> ~/tmp>gfortran -v gfbug.f90 
> Driving: gfortran -v gfbug.f90 -lgfortranbegin -lgfortran -lm -shared-libgcc
> Reading specs from /afs/mpa/data/martin/ugcc/lib/gcc/i686-pc-linux-gnu/4.0.0/specs
> Configured with: /scratch/gcc/configure --quiet
> --prefix=/afs/mpa/data/martin/ugcc --enable-languages=c++,f95
> --with-gmp=/afs/mpa/data/martin/mygmp
> Thread model: posix
> gcc version 4.0.0 20041021 (experimental)
>  /afs/mpa/data/martin/ugcc/libexec/gcc/i686-pc-linux-gnu/4.0.0/f951 gfbug.f90
> -quiet -dumpbase gfbug.f90 -mtune=pentiumpro -auxbase gfbug -version -o
> /tmp/ccTKCcxy.s
> GNU F95 version 4.0.0 20041021 (experimental) (i686-pc-linux-gnu)
>         compiled by GNU C version 4.0.0 20041021 (experimental).
> GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
>  In file gfbug.f90:27
> 
>   l = bar (3)
>         1
> Error: Symbol 'bar' at (1) has no IMPLICIT type
> 
> In principle gfortran should be able to choose the correct variant of "bar"
> with the information it has. All other compilers I tried (ifc, NAG, xlf95)
> accept this code.

(In reply to comment #11)
> (In reply to comment #10)
> 
> > Does this mean that calling twice is a verified workaround solution?  Should I
> > have confidence in the results of this workaround?
> 
> Even if it was, this is not a practical solution in for large code bases like
> the one I have to maintain.
> What's worrying me most is that nobody appears to understand what's going wrong.
> (And that for a very long time now.)
> 
> Since half a year, this is the one bug preventing me from using gfortran to
> compile my code base and report more bugs :(
> 

(In reply to comment #11)
> (In reply to comment #10)
> 
> > Does this mean that calling twice is a verified workaround solution?  Should I
> > have confidence in the results of this workaround?
> 
> Even if it was, this is not a practical solution in for large code bases like
> the one I have to maintain.
> What's worrying me most is that nobody appears to understand what's going wrong.
> (And that for a very long time now.)
> 
> Since half a year, this is the one bug preventing me from using gfortran to
> compile my code base and report more bugs :(
> 

-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (15 preceding siblings ...)
  2005-06-13 14:13 ` david dot c dot gregory at gmail dot com
@ 2005-07-07 22:38 ` steven at gcc dot gnu dot org
  2005-07-15 20:40 ` tkoenig at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-07-07 22:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2005-07-07 22:37 -------
This is one bad nasty ugly bug. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
           Priority|P2                          |P1


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (16 preceding siblings ...)
  2005-07-07 22:38 ` steven at gcc dot gnu dot org
@ 2005-07-15 20:40 ` tkoenig at gcc dot gnu dot org
  2005-08-02  7:54 ` paulthomas2 at wanadoo dot fr
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2005-07-15 20:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tkoenig at gcc dot gnu dot org  2005-07-15 20:25 -------
(In reply to comment #16)
> This is one bad nasty ugly bug. 

Yep.

This "works" (for small values of "works") if the IMPLICIT NONE
is omitted.

The problem appears to be that resolve_symbol() doesn't find the
generic function, but sets the symbol to a variable of default
type using gfc_set_default_type().  Without IMPLICIT NONE, this is
harmless and will get corrected later on.  With IMPLICIT NONE,
gfc_set_default_type() throws an error.

I can think of two solutions:

a) Find a way for resolve_symbol() to look at the generic functions

b) Save type error checking for later, when generics have been resolved.

-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (17 preceding siblings ...)
  2005-07-15 20:40 ` tkoenig at gcc dot gnu dot org
@ 2005-08-02  7:54 ` paulthomas2 at wanadoo dot fr
  2005-08-02 10:14 ` c dot lemmen at fz-juelich dot de
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: paulthomas2 at wanadoo dot fr @ 2005-08-02  7:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From paulthomas2 at wanadoo dot fr  2005-08-02 07:54 -------
I do apologise for missing this one:  My fix for PR16940 fixes this fellow too.

I would be grateful if the reporters can give the latest cvs a whirl to confirm 
that this is the case.

This expanded testcase now works:


module foo
implicit none

interface bar
  module procedure bar1, bar2
end interface

contains

function bar1 (arg)
  integer arg
  logical bar1

  bar1 = (arg==0)
end function

function bar2 (arg)
  real arg
  logical bar2

  bar2 = (arg==0)
end function

subroutine baz
  logical l
  l = bar (3)
  print *, "BAZ: bar (0) =", bar (0), "  bar (1.0) =", bar (1.0)
end subroutine

end module foo

program test_18108
  use foo
  print *, "bar (0) =", bar (0), "  bar (1) =", bar (1)
  print *, "bar (0.0) =", bar (0.0), "  bar (1.0) =", bar (1.0)
  call baz ()
end program test_18108


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (18 preceding siblings ...)
  2005-08-02  7:54 ` paulthomas2 at wanadoo dot fr
@ 2005-08-02 10:14 ` c dot lemmen at fz-juelich dot de
  2005-08-02 10:24 ` steven at gcc dot gnu dot org
  2005-08-11 22:27 ` pinskia at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: c dot lemmen at fz-juelich dot de @ 2005-08-02 10:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From c dot lemmen at fz-juelich dot de  2005-08-02 10:14 -------
(In reply to comment #18)
> I do apologise for missing this one:  My fix for PR16940 fixes this fellow too.
> 
> I would be grateful if the reporters can give the latest cvs a whirl to confirm 
> that this is the case.
> 

This bug has quietly disappeared from my code as of gcc-20050722.  Today's cvs
gcc-20050802 is working fine as well. 

So yes, it seems indeed fixed.  Many thanks to everyone involved.


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (19 preceding siblings ...)
  2005-08-02 10:14 ` c dot lemmen at fz-juelich dot de
@ 2005-08-02 10:24 ` steven at gcc dot gnu dot org
  2005-08-11 22:27 ` pinskia at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-08-02 10:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2005-08-02 10:24 -------
My example from the SPEC benchmark candidate is also fixed.  Yay! 
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug fortran/18108] [gfortran] overloading does not work for functions
  2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
                   ` (20 preceding siblings ...)
  2005-08-02 10:24 ` steven at gcc dot gnu dot org
@ 2005-08-11 22:27 ` pinskia at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-11 22:27 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.2


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2005-08-11 22:27 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
2004-10-22  8:47 ` [Bug fortran/18108] " martin at mpa-garching dot mpg dot de
2004-10-29  8:13 ` c dot lemmen at fz-juelich dot de
2004-11-11 11:44 ` c dot lemmen at fz-juelich dot de
2004-11-12 10:40 ` martin at mpa-garching dot mpg dot de
2004-11-26 13:33 ` martin at mpa-garching dot mpg dot de
2004-11-26 14:40 ` bdavis at gcc dot gnu dot org
2004-11-30 15:21 ` tobi at gcc dot gnu dot org
2004-11-30 15:22 ` tobi at gcc dot gnu dot org
2005-01-11  0:17 ` steven at gcc dot gnu dot org
2005-05-05 16:40 ` pinskia at gcc dot gnu dot org
2005-06-08  8:57 ` c dot lemmen at fz-juelich dot de
2005-06-08  9:02 ` martin at mpa-garching dot mpg dot de
2005-06-08 10:20 ` c dot lemmen at fz-juelich dot de
2005-06-08 11:28 ` c dot lemmen at fz-juelich dot de
2005-06-09 10:16 ` martin at mpa-garching dot mpg dot de
2005-06-13 14:13 ` david dot c dot gregory at gmail dot com
2005-07-07 22:38 ` steven at gcc dot gnu dot org
2005-07-15 20:40 ` tkoenig at gcc dot gnu dot org
2005-08-02  7:54 ` paulthomas2 at wanadoo dot fr
2005-08-02 10:14 ` c dot lemmen at fz-juelich dot de
2005-08-02 10:24 ` steven at gcc dot gnu dot org
2005-08-11 22:27 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).