public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/25061]  New: better diagnostic needed
@ 2005-11-26 17:49 jv244 at cam dot ac dot uk
  2005-11-26 19:31 ` [Bug fortran/25061] procedure name conflict fxcoudert at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jv244 at cam dot ac dot uk @ 2005-11-26 17:49 UTC (permalink / raw)
  To: gcc-bugs

using GNU Fortran 95 (GCC) 4.1.0 20051126 (prerelease)  with '-g -pedantic
-std=f95', I get a bad / no diagnostic for the following invalid code:

INTERFACE I1
 SUBROUTINE S1(I)
 END SUBROUTINE S1
 SUBROUTINE S2(R)
 END SUBROUTINE S2
END INTERFACE I1
CONTAINS
 SUBROUTINE I1(I)
 END SUBROUTINE I1
END


-- 
           Summary: better diagnostic needed
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


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


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

* [Bug fortran/25061] procedure name conflict
  2005-11-26 17:49 [Bug fortran/25061] New: better diagnostic needed jv244 at cam dot ac dot uk
@ 2005-11-26 19:31 ` fxcoudert at gcc dot gnu dot org
  2007-05-18 14:49 ` dfranke at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-11-26 19:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from fxcoudert at gcc dot gnu dot org  2005-11-26 19:31 -------
gfortran doesn't catch that issue:

## Intel ##
fortcom: Warning: foo.f90, line 2: This name has not been given an explicit
type.   [I]
 SUBROUTINE S1(I)
---------------^
fortcom: Warning: foo.f90, line 4: This name has not been given an explicit
type.   [R]
 SUBROUTINE S2(R)
---------------^
fortcom: Warning: foo.f90, line 8: This name has not been given an explicit
type.   [I]
 SUBROUTINE I1(I)
---------------^
fortcom: Error: foo.f90, line 8: The name of the internal procedure conflicts
with a name in the encompassing scoping unit.   [I1]
 SUBROUTINE I1(I)
------------^
fortcom: Info: foo.f90, line 8: This variable has not been used.   [I]
 SUBROUTINE I1(I)
---------------^
compilation aborted for foo.f90 (code 1)
## Portland ##
## Sun ##

 SUBROUTINE I1(I)
            ^
"foo.f90", Line = 8, Column = 13: ERROR: "I1" is a generic-name, therefore it
must not be declared as a internal subroutine.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |accepts-invalid
   Last reconfirmed|0000-00-00 00:00:00         |2005-11-26 19:31:49
               date|                            |
            Summary|better diagnostic needed    |procedure name conflict


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


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

* [Bug fortran/25061] procedure name conflict
  2005-11-26 17:49 [Bug fortran/25061] New: better diagnostic needed jv244 at cam dot ac dot uk
  2005-11-26 19:31 ` [Bug fortran/25061] procedure name conflict fxcoudert at gcc dot gnu dot org
@ 2007-05-18 14:49 ` dfranke at gcc dot gnu dot org
  2007-06-19  5:00 ` patchapp at dberlin dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-05-18 14:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dfranke at gcc dot gnu dot org  2007-05-18 15:49 -------
I had a short look at this. The problem is in decl.c:693f:

      if (sym->attr.flavor != 0
          && sym->attr.proc != 0
          && (sym->attr.subroutine || sym->attr.function)
          && sym->attr.if_source != IFSRC_UNKNOWN)
        gfc_error_now ("Procedure '%s' at %C is already defined at %L",
                       name, &sym->declared_at);

(gdb) print sym->name
$5 = 0x887e4f6 "i1"
(gdb) print sym->attr.proc
$8 = PROC_UNKNOWN
(gdb) print sym->attr.if_source
$10 = IFSRC_UNKNOWN

Interestingly, if the subroutine I1 is duplicated, the expected error (I1
already defined as interface) is emitted:

$> cat pr25061.f90
MODULE foo
INTERFACE I1
  SUBROUTINE S1(I)
  END SUBROUTINE S1
  SUBROUTINE S2(R)
  END SUBROUTINE S2
END INTERFACE I1
CONTAINS
  SUBROUTINE I1(I)
  END SUBROUTINE I1
  SUBROUTINE I1(R)           ! same as before, but I1 in triplicate now
  END SUBROUTINE I1
END MODULE

$> gfortran-svn -g -Wall 
pr25061.f90:11.15:

  SUBROUTINE I1(R)
              1
pr25061.f90:2.12:

INTERFACE I1
           2
Error: Procedure 'i1' at (1) is already defined at (2)

$> gfortran-svn -v
gcc version 4.3.0 20070517 (experimental)


Adding Paul, The Interface Wizard, Thomas as CC. He will probably now how to
handle this :)


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org, pault at gcc dot gnu
                   |                            |dot org


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


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

* [Bug fortran/25061] procedure name conflict
  2005-11-26 17:49 [Bug fortran/25061] New: better diagnostic needed jv244 at cam dot ac dot uk
  2005-11-26 19:31 ` [Bug fortran/25061] procedure name conflict fxcoudert at gcc dot gnu dot org
  2007-05-18 14:49 ` dfranke at gcc dot gnu dot org
@ 2007-06-19  5:00 ` patchapp at dberlin dot org
  2007-06-21  1:18 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: patchapp at dberlin dot org @ 2007-06-19  5:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from patchapp at dberlin dot org  2007-06-19 05:00 -------
Subject: Bug number PR25061

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-06/msg01294.html


-- 


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


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

* [Bug fortran/25061] procedure name conflict
  2005-11-26 17:49 [Bug fortran/25061] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2007-06-19  5:00 ` patchapp at dberlin dot org
@ 2007-06-21  1:18 ` jvdelisle at gcc dot gnu dot org
  2007-06-21  1:48 ` jvdelisle at gcc dot gnu dot org
  2007-06-21  2:11 ` jvdelisle at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-06-21  1:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jvdelisle at gcc dot gnu dot org  2007-06-21 01:18 -------
Subject: Bug 25061

Author: jvdelisle
Date: Thu Jun 21 01:18:02 2007
New Revision: 125906

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125906
Log:
2007-06-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR fortran/25061
        * decl.c (get_proc_name) Check symbol for generic interface
        and issue an error.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c


-- 


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


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

* [Bug fortran/25061] procedure name conflict
  2005-11-26 17:49 [Bug fortran/25061] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (3 preceding siblings ...)
  2007-06-21  1:18 ` jvdelisle at gcc dot gnu dot org
@ 2007-06-21  1:48 ` jvdelisle at gcc dot gnu dot org
  2007-06-21  2:11 ` jvdelisle at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-06-21  1:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jvdelisle at gcc dot gnu dot org  2007-06-21 01:48 -------
Subject: Bug 25061

Author: jvdelisle
Date: Thu Jun 21 01:48:21 2007
New Revision: 125907

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125907
Log:
2007-06-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR fortran/25061
        gfortran.dg/invalid_procedure_name.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/invalid_procedure_name.f90
Modified:
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/25061] procedure name conflict
  2005-11-26 17:49 [Bug fortran/25061] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (4 preceding siblings ...)
  2007-06-21  1:48 ` jvdelisle at gcc dot gnu dot org
@ 2007-06-21  2:11 ` jvdelisle at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-06-21  2:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jvdelisle at gcc dot gnu dot org  2007-06-21 02:11 -------
Fixed on 4.3, closing


-- 

jvdelisle at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2007-06-21  2:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-26 17:49 [Bug fortran/25061] New: better diagnostic needed jv244 at cam dot ac dot uk
2005-11-26 19:31 ` [Bug fortran/25061] procedure name conflict fxcoudert at gcc dot gnu dot org
2007-05-18 14:49 ` dfranke at gcc dot gnu dot org
2007-06-19  5:00 ` patchapp at dberlin dot org
2007-06-21  1:18 ` jvdelisle at gcc dot gnu dot org
2007-06-21  1:48 ` jvdelisle at gcc dot gnu dot org
2007-06-21  2:11 ` jvdelisle 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).