public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/16940] New: implicit none over-riding module declaration
@ 2004-08-09 14:31 paulthomas2 at wanadoo dot fr
  2004-08-19 15:37 ` [Bug fortran/16940] " tobi at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: paulthomas2 at wanadoo dot fr @ 2004-08-09 14:31 UTC (permalink / raw)
  To: gcc-bugs

! note Max_Loc_Mod MUST be separated in bug6mod.f90 - another bug?
!
! The "implicit none" on line 20 causes (compiles and runs OK if deleted):
!
!  $ ../bin/gfortran bug6mod.f90 bug6.f90 -o test
!   In file bug6.f90:9
!  
!        N = Max_Loc (Unsorted)  ! Location of largest element
!                  1
!  Error: Symbol 'max_loc' at (1) has no IMPLICIT type
!   In file bug6.f90:14
!
!      use Sel_Sort_Mod
!                      1
!  Fatal Error: Can't open module file 'sel_sort_mod.mod' for reading at (1): No su
!  ch file or directory

  module Sel_Sort_Mod 
    use Max_Loc_Mod 
    implicit none 
  contains 
    recursive subroutine Selection_Sort (Unsorted)  
      real, intent (in out) :: Unsorted (:) 
      integer :: N
      N = Max_Loc (Unsorted)  ! Location of largest element 
      return 
    end subroutine Selection_Sort 
  end module Sel_Sort_Mod 
  program Variety 
    use Sel_Sort_Mod 
    implicit none 
    real :: Vector (2)
    Vector = (/1.0,2.0/) 
    call Selection_Sort (Vector) 
    stop 
  end program Variety 

!bug6mod.f90 *********

  module Max_Loc_Mod 
    implicit none 
    interface Max_Loc 
      module procedure I_Max_Loc, R_Max_Loc 
    end interface 
  contains 
    function I_Max_Loc (Vector) result(Ans)
      integer, intent (in), dimension(:) :: Vector 
      integer :: Ans 
      Ans = size(Vector)
      return 
    end function I_Max_Loc 
    function R_Max_Loc (Vector) result(Ans)
      real, intent (in), dimension(:) :: Vector 
      integer :: Ans
      Ans = size(Vector)
      return 
    end function R_Max_Loc 
  end module Max_Loc_Mod

-- 
           Summary: implicit none over-riding module declaration
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: paulthomas2 at wanadoo dot fr
                CC: bdavis at gcc dot gnu dot org,gcc-bugs at gcc dot gnu
                    dot org


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


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

* [Bug fortran/16940] implicit none over-riding module declaration
  2004-08-09 14:31 [Bug fortran/16940] New: implicit none over-riding module declaration paulthomas2 at wanadoo dot fr
@ 2004-08-19 15:37 ` tobi at gcc dot gnu dot org
  2004-08-29 17:40 ` tobi at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-08-19 15:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-08-19 15:37 -------
Confirmed. Removing IMPLICIT NONE fixes the problem.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-08-19 15:37:03
               date|                            |


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


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

* [Bug fortran/16940] implicit none over-riding module declaration
  2004-08-09 14:31 [Bug fortran/16940] New: implicit none over-riding module declaration paulthomas2 at wanadoo dot fr
  2004-08-19 15:37 ` [Bug fortran/16940] " tobi at gcc dot gnu dot org
@ 2004-08-29 17:40 ` tobi at gcc dot gnu dot org
  2004-08-29 18:44 ` paulthomas2 at wanadoo dot fr
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-08-29 17:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-08-29 17:40 -------
What is funky is that with IMPLICIT NONE removed, we generate a call to the
right function (the one for real arguments) eSomething really weird seems to be
going on here.

-- 


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


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

* [Bug fortran/16940] implicit none over-riding module declaration
  2004-08-09 14:31 [Bug fortran/16940] New: implicit none over-riding module declaration paulthomas2 at wanadoo dot fr
  2004-08-19 15:37 ` [Bug fortran/16940] " tobi at gcc dot gnu dot org
  2004-08-29 17:40 ` tobi at gcc dot gnu dot org
@ 2004-08-29 18:44 ` paulthomas2 at wanadoo dot fr
  2004-08-29 22:46 ` tobi at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: paulthomas2 at wanadoo dot fr @ 2004-08-29 18:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From paulthomas2 at wanadoo dot fr  2004-08-29 18:43 -------
Subject: Re:  implicit none over-riding module declaration

Yeah, I thought it was really strange too.  It is only be chance that I
notice the fix of removing the IMPLICT NONE.

Paul T

----- Original Message ----- 
From: "tobi at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: <paulthomas2@wanadoo.fr>
Sent: Sunday, August 29, 2004 7:40 PM
Subject: [Bug fortran/16940] implicit none over-riding module declaration


>
> ------- Additional Comments From tobi at gcc dot gnu dot org  2004-08-29
17:40 -------
> What is funky is that with IMPLICIT NONE removed, we generate a call to
the
> right function (the one for real arguments) eSomething really weird seems
to be
> going on here.
>
> -- 
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16940
>
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.



-- 


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


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

* [Bug fortran/16940] implicit none over-riding module declaration
  2004-08-09 14:31 [Bug fortran/16940] New: implicit none over-riding module declaration paulthomas2 at wanadoo dot fr
                   ` (2 preceding siblings ...)
  2004-08-29 18:44 ` paulthomas2 at wanadoo dot fr
@ 2004-08-29 22:46 ` tobi at gcc dot gnu dot org
  2004-08-30 11:06 ` tobi at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-08-29 22:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-08-29 22:46 -------
Thinking about this some more, I thought of this one-line fix. And indeed, it
seems to work. The funky thing that was going on was that we tried to give a
type to the symbol which represents the named interface. This of course makes no
sense.

I will post this patch to the mailing list once the testsuite finishes and after
testing with some more testcases to make sure that this doesn't break anything else.

Index: resolve.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/resolve.c,v
retrieving revision 1.16
diff -u -p -r1.16 resolve.c
--- resolve.c   27 Aug 2004 14:49:34 -0000      1.16
+++ resolve.c   29 Aug 2004 22:43:17 -0000
@@ -3828,7 +3828,8 @@ resolve_symbol (gfc_symbol * sym)
       if (sym->attr.flavor == FL_VARIABLE || sym->attr.flavor == FL_PARAMETER)
        gfc_set_default_type (sym, 1, NULL);

-      if (sym->attr.flavor == FL_PROCEDURE && sym->attr.function)
+      if (sym->attr.flavor == FL_PROCEDURE && sym->attr.function
+         && !sym->generic)
        {
          if (!mp_flag)
            gfc_set_default_type (sym, 0, NULL);


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tobi at gcc dot gnu dot org
           Keywords|                            |patch, rejects-valid


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


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

* [Bug fortran/16940] implicit none over-riding module declaration
  2004-08-09 14:31 [Bug fortran/16940] New: implicit none over-riding module declaration paulthomas2 at wanadoo dot fr
                   ` (3 preceding siblings ...)
  2004-08-29 22:46 ` tobi at gcc dot gnu dot org
@ 2004-08-30 11:06 ` tobi at gcc dot gnu dot org
  2004-09-16 14:12 ` [Bug fortran/16940] Failure to perform host association correctly tobi at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-08-30 11:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-08-30 11:05 -------
Hm, when constructing a testcase it suddenly didn't work any more, and I
couldn't get it workng again. Maybe I was too tired yesterday and looked at the
wrong thing. 

The real problem seems to be that host association is not working correctly:
adding 'use Max_Loc_Mod' in the beginning of Selection_Sort fixes the problem,
even though the statement should have no effect (in this case, there are cases
where it would have an effect).

-- 


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


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

* [Bug fortran/16940] Failure to perform host association correctly
  2004-08-09 14:31 [Bug fortran/16940] New: implicit none over-riding module declaration paulthomas2 at wanadoo dot fr
                   ` (4 preceding siblings ...)
  2004-08-30 11:06 ` tobi at gcc dot gnu dot org
@ 2004-09-16 14:12 ` tobi at gcc dot gnu dot org
  2004-09-23 17:56 ` tobi at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-09-16 14:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-09-16 14:12 -------
Updated summary, removed patch from keywords to reflect status more correctly.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|patch                       |
            Summary|implicit none over-riding   |Failure to perform host
                   |module declaration          |association correctly


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


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

* [Bug fortran/16940] Failure to perform host association correctly
  2004-08-09 14:31 [Bug fortran/16940] New: implicit none over-riding module declaration paulthomas2 at wanadoo dot fr
                   ` (5 preceding siblings ...)
  2004-09-16 14:12 ` [Bug fortran/16940] Failure to perform host association correctly tobi at gcc dot gnu dot org
@ 2004-09-23 17:56 ` tobi at gcc dot gnu dot org
  2004-09-23 19:32   ` Toon Moene
  2004-09-23 19:43 ` tobi at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 14+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-09-23 17:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-09-23 17:56 -------
*** Bug 17630 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giannozz at nest dot sns dot
                   |                            |it


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


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

* Re: [Bug fortran/16940] Failure to perform host association correctly
  2004-09-23 17:56 ` tobi at gcc dot gnu dot org
@ 2004-09-23 19:32   ` Toon Moene
  2004-09-23 19:42     ` Tobias Schlüter
  0 siblings, 1 reply; 14+ messages in thread
From: Toon Moene @ 2004-09-23 19:32 UTC (permalink / raw)
  To: Tobias Schlüter; +Cc: gcc-bugs

tobi at gcc dot gnu dot org wrote:

> ------- Additional Comments From tobi at gcc dot gnu dot org  2004-09-23 17:56 -------
> *** Bug 17630 has been marked as a duplicate of this bug. ***
> 
Don't you think it's rather a dupe of

	http://gcc.gnu.org/PR17379

?

Or are they just all dupes of each other :-)

-- 
Toon Moene - e-mail: toon@moene.indiv.nluug.nl - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/


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

* Re: [Bug fortran/16940] Failure to perform host association correctly
  2004-09-23 19:32   ` Toon Moene
@ 2004-09-23 19:42     ` Tobias Schlüter
  0 siblings, 0 replies; 14+ messages in thread
From: Tobias Schlüter @ 2004-09-23 19:42 UTC (permalink / raw)
  To: Toon Moene; +Cc: gcc-bugs

Toon Moene wrote:
> tobi at gcc dot gnu dot org wrote:
> 
> 
>>------- Additional Comments From tobi at gcc dot gnu dot org  2004-09-23 17:56 -------
>>*** Bug 17630 has been marked as a duplicate of this bug. ***
>>
> 
> Don't you think it's rather a dupe of
> 
> 	http://gcc.gnu.org/PR17379
> 
> ?
> 
> Or are they just all dupes of each other :-)
> 

I think they all expose the same shortcoming (whatever it maybe exactly).

Since we deal with symbols in the same way, independent if they are functions
or variables, I think that the bug with the most general summary wins in this
case :-)

I'll also mark PR 17379 a dup of 16940.

- Tobi


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

* [Bug fortran/16940] Failure to perform host association correctly
  2004-08-09 14:31 [Bug fortran/16940] New: implicit none over-riding module declaration paulthomas2 at wanadoo dot fr
                   ` (6 preceding siblings ...)
  2004-09-23 17:56 ` tobi at gcc dot gnu dot org
@ 2004-09-23 19:43 ` tobi at gcc dot gnu dot org
  2005-07-19 20:20 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-09-23 19:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-09-23 19:43 -------
*** Bug 17379 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |CARendleman at lbl dot gov


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


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

* [Bug fortran/16940] Failure to perform host association correctly
  2004-08-09 14:31 [Bug fortran/16940] New: implicit none over-riding module declaration paulthomas2 at wanadoo dot fr
                   ` (7 preceding siblings ...)
  2004-09-23 19:43 ` tobi at gcc dot gnu dot org
@ 2005-07-19 20:20 ` cvs-commit at gcc dot gnu dot org
  2005-07-22 19:09 ` cvs-commit at gcc dot gnu dot org
  2005-07-22 19:13 ` paulthomas2 at wanadoo dot fr
  10 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-07-19 20:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-07-19 20:14 -------
Subject: Bug 16940

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pault@gcc.gnu.org	2005-07-19 20:14:03

Modified files:
	gcc/fortran    : resolve.c ChangeLog 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: module_interface_1.f90 

Log message:
	2005-07-19 Paul Thomas  <pault@gcc.gnu.org>
	
	PR fortran/16940
	* resolve.c (resolve_symbol): A symbol with FL_UNKNOWN
	is matched against interfaces in parent namespaces. If there
	the symtree is set to point to the interface.
	
	2005-07-19 Paul Thomas  <pault@gcc.gnu.org>
	
	PR fortran/16940
	* gfortran.dg/module_interface_1.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&r1=1.45&r2=1.46
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.498&r2=1.499
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/module_interface_1.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5784&r2=1.5785



-- 


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


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

* [Bug fortran/16940] Failure to perform host association correctly
  2004-08-09 14:31 [Bug fortran/16940] New: implicit none over-riding module declaration paulthomas2 at wanadoo dot fr
                   ` (8 preceding siblings ...)
  2005-07-19 20:20 ` cvs-commit at gcc dot gnu dot org
@ 2005-07-22 19:09 ` cvs-commit at gcc dot gnu dot org
  2005-07-22 19:13 ` paulthomas2 at wanadoo dot fr
  10 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-07-22 19:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-07-22 19:03 -------
Subject: Bug 16940

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	pault@gcc.gnu.org	2005-07-22 19:03:39

Modified files:
	gcc/fortran    : resolve.c ChangeLog 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: module_interface_1.f90 

Log message:
	2005-07-22 Paul Thomas  <pault@gcc.gnu.org>
	
	PR fortran/16940
	* resolve.c (resolve_symbol): A symbol with FL_UNKNOWN
	is matched against interfaces in parent namespaces. If there
	the symtree is set to point to the interface.
	
	2005-07-22 Paul Thomas  <pault@gcc.gnu.org>
	
	PR fortran/16940
	* gfortran.dg/module_interface.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.34.2.10&r2=1.34.2.11
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.335.2.93&r2=1.335.2.94
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/module_interface_1.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.4.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.292&r2=1.5084.2.293



-- 


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


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

* [Bug fortran/16940] Failure to perform host association correctly
  2004-08-09 14:31 [Bug fortran/16940] New: implicit none over-riding module declaration paulthomas2 at wanadoo dot fr
                   ` (9 preceding siblings ...)
  2005-07-22 19:09 ` cvs-commit at gcc dot gnu dot org
@ 2005-07-22 19:13 ` paulthomas2 at wanadoo dot fr
  10 siblings, 0 replies; 14+ messages in thread
From: paulthomas2 at wanadoo dot fr @ 2005-07-22 19:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From paulthomas2 at wanadoo dot fr  2005-07-22 19:13 -------
Fixed on mainline and 4.02

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


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


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

end of thread, other threads:[~2005-07-22 19:13 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-09 14:31 [Bug fortran/16940] New: implicit none over-riding module declaration paulthomas2 at wanadoo dot fr
2004-08-19 15:37 ` [Bug fortran/16940] " tobi at gcc dot gnu dot org
2004-08-29 17:40 ` tobi at gcc dot gnu dot org
2004-08-29 18:44 ` paulthomas2 at wanadoo dot fr
2004-08-29 22:46 ` tobi at gcc dot gnu dot org
2004-08-30 11:06 ` tobi at gcc dot gnu dot org
2004-09-16 14:12 ` [Bug fortran/16940] Failure to perform host association correctly tobi at gcc dot gnu dot org
2004-09-23 17:56 ` tobi at gcc dot gnu dot org
2004-09-23 19:32   ` Toon Moene
2004-09-23 19:42     ` Tobias Schlüter
2004-09-23 19:43 ` tobi at gcc dot gnu dot org
2005-07-19 20:20 ` cvs-commit at gcc dot gnu dot org
2005-07-22 19:09 ` cvs-commit at gcc dot gnu dot org
2005-07-22 19:13 ` paulthomas2 at wanadoo dot fr

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).