public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/35997]  New: Used function interface bug
@ 2008-04-21 10:02 drewmccormack at mac dot com
  2008-04-22  1:20 ` [Bug fortran/35997] [4.3/4.4 regression]Used " jvdelisle at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: drewmccormack at mac dot com @ 2008-04-21 10:02 UTC (permalink / raw)
  To: gcc-bugs

Code that has a function interface used from two modules can fail if one of the
modules renames the function interface. The example below fails to compile with
this message:

gfortran testfuncinterface.f90 
testfuncinterface.f90:21.7:

  if ( valid() ) then
      1
Error: IF clause at (1) requires a scalar LOGICAL expression


Source Code:

module funcinterfacemod

  interface
    logical function valid()
    end function
  end interface

end module

module secondmod
  use funcinterfacemod, valid2 => valid
end module

logical function valid()
  valid = .true.
end function

program main
  use secondmod
  use funcinterfacemod
  if ( valid() ) then
    print *,'Is Valid'
  endif
end program


This example does compile is the order of the use statements is reversed. This
also compiles on earlier versions of gfortran (eg 4.3.0 20071114 (experimental)
(GCC))


-- 
           Summary: Used function interface bug
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: drewmccormack at mac dot com
 GCC build triplet: 4.3.0 20080125 (experimental) (GCC)
  GCC host triplet: i386-apple-darwin8.11.1
GCC target triplet: i386-apple-darwin8.11.1


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


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

* [Bug fortran/35997] [4.3/4.4 regression]Used function interface bug
  2008-04-21 10:02 [Bug fortran/35997] New: Used function interface bug drewmccormack at mac dot com
@ 2008-04-22  1:20 ` jvdelisle at gcc dot gnu dot org
  2008-04-28 11:55 ` pault at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-04-22  1:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jvdelisle at gcc dot gnu dot org  2008-04-22 01:19 -------
Confirmed.  Works for me on 4.2.4, Fails on 4.3.1


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|                            |4.3.1 4.4.0
      Known to work|                            |4.2.4
   Last reconfirmed|0000-00-00 00:00:00         |2008-04-22 01:19:55
               date|                            |
            Summary|Used function interface bug |[4.3/4.4 regression]Used
                   |                            |function interface bug


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


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

* [Bug fortran/35997] [4.3/4.4 regression]Used function interface bug
  2008-04-21 10:02 [Bug fortran/35997] New: Used function interface bug drewmccormack at mac dot com
  2008-04-22  1:20 ` [Bug fortran/35997] [4.3/4.4 regression]Used " jvdelisle at gcc dot gnu dot org
@ 2008-04-28 11:55 ` pault at gcc dot gnu dot org
  2008-04-30 20:15 ` pault at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-04-28 11:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pault at gcc dot gnu dot org  2008-04-28 11:55 -------
Created an attachment (id=15541)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15541&action=view)
Fix for this PR

This seems to do the job.  The problem arises because the present version of
module.c does not add a new symtree that is not renamed if the symbol is
already present.  The test in module.c(find_symbol) was failing to resolve the
case where the renaming is already done in the module that is being use
associated.  This patch accomplishes this by looking for a symtree with the
same name as the symbol and, upon failure, checking that the symbol is not
renamed; this can only correspond to the unresolved case.

I will develop a proper testcase and submit later on today.


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug fortran/35997] [4.3/4.4 regression]Used function interface bug
  2008-04-21 10:02 [Bug fortran/35997] New: Used function interface bug drewmccormack at mac dot com
  2008-04-22  1:20 ` [Bug fortran/35997] [4.3/4.4 regression]Used " jvdelisle at gcc dot gnu dot org
  2008-04-28 11:55 ` pault at gcc dot gnu dot org
@ 2008-04-30 20:15 ` pault at gcc dot gnu dot org
  2008-05-05  5:30 ` [Bug fortran/35997] [4.3/4.4 regression] Used " pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-04-30 20:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pault at gcc dot gnu dot org  2008-04-30 20:14 -------
Subject: Bug 35997

Author: pault
Date: Wed Apr 30 20:13:21 2008
New Revision: 134836

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134836
Log:
2008-04-30  Paul Thomas  <pault@gcc.gnu.org>

       PR fortran/35997
       * module.c (find_symbol): Do not return a result for a symbol
       that has been renamed in another module.

2008-04-30  Paul Thomas  <pault@gcc.gnu.org>

       PR fortran/35997
       * gfortran.dg/use_rename_3.f90

Added:
    trunk/gcc/testsuite/gfortran.dg/use_rename_3.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/module.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/35997] [4.3/4.4 regression] Used function interface bug
  2008-04-21 10:02 [Bug fortran/35997] New: Used function interface bug drewmccormack at mac dot com
                   ` (2 preceding siblings ...)
  2008-04-30 20:15 ` pault at gcc dot gnu dot org
@ 2008-05-05  5:30 ` pinskia at gcc dot gnu dot org
  2008-05-05 15:48 ` jsm28 at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-05-05  5:30 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.3/4.4 regression]Used    |[4.3/4.4 regression] Used
                   |function interface bug      |function interface bug
   Target Milestone|---                         |4.3.1


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


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

* [Bug fortran/35997] [4.3/4.4 regression] Used function interface bug
  2008-04-21 10:02 [Bug fortran/35997] New: Used function interface bug drewmccormack at mac dot com
                   ` (3 preceding siblings ...)
  2008-05-05  5:30 ` [Bug fortran/35997] [4.3/4.4 regression] Used " pinskia at gcc dot gnu dot org
@ 2008-05-05 15:48 ` jsm28 at gcc dot gnu dot org
  2008-05-05 17:06 ` burnus at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-05-05 15:48 UTC (permalink / raw)
  To: gcc-bugs



-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4


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


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

* [Bug fortran/35997] [4.3/4.4 regression] Used function interface bug
  2008-04-21 10:02 [Bug fortran/35997] New: Used function interface bug drewmccormack at mac dot com
                   ` (4 preceding siblings ...)
  2008-05-05 15:48 ` jsm28 at gcc dot gnu dot org
@ 2008-05-05 17:06 ` burnus at gcc dot gnu dot org
  2008-05-13 20:28 ` pault at gcc dot gnu dot org
  2008-05-13 20:29 ` pault at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-05-05 17:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from burnus at gcc dot gnu dot org  2008-05-05 17:05 -------
It would be nice if this could go into 4.3.1; its release was scheduled for
today, but it got delayed by three P1 regressions.


-- 


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


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

* [Bug fortran/35997] [4.3/4.4 regression] Used function interface bug
  2008-04-21 10:02 [Bug fortran/35997] New: Used function interface bug drewmccormack at mac dot com
                   ` (5 preceding siblings ...)
  2008-05-05 17:06 ` burnus at gcc dot gnu dot org
@ 2008-05-13 20:28 ` pault at gcc dot gnu dot org
  2008-05-13 20:29 ` pault at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-05-13 20:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2008-05-13 20:27 -------
Subject: Bug 35997

Author: pault
Date: Tue May 13 20:26:47 2008
New Revision: 135273

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=135273
Log:
2008-05-13  Paul Thomas  <pault@gcc.gnu.org>

       PR fortran/35997
       * module.c (find_symbol): Do not return a result for a symbol
       that has been renamed in another module.

2008-05-13  Paul Thomas  <pault@gcc.gnu.org>

       PR fortran/35997
       * gfortran.dg/use_rename_3.f90


Added:
    branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/used_rename_3.f90
Modified:
    branches/gcc-4_3-branch/gcc/fortran/ChangeLog
    branches/gcc-4_3-branch/gcc/fortran/module.c
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/35997] [4.3/4.4 regression] Used function interface bug
  2008-04-21 10:02 [Bug fortran/35997] New: Used function interface bug drewmccormack at mac dot com
                   ` (6 preceding siblings ...)
  2008-05-13 20:28 ` pault at gcc dot gnu dot org
@ 2008-05-13 20:29 ` pault at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-05-13 20:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pault at gcc dot gnu dot org  2008-05-13 20:28 -------
Fixed on trunk and 4.3

Thanks for the report.

Paul


-- 

pault at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-05-13 20:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-21 10:02 [Bug fortran/35997] New: Used function interface bug drewmccormack at mac dot com
2008-04-22  1:20 ` [Bug fortran/35997] [4.3/4.4 regression]Used " jvdelisle at gcc dot gnu dot org
2008-04-28 11:55 ` pault at gcc dot gnu dot org
2008-04-30 20:15 ` pault at gcc dot gnu dot org
2008-05-05  5:30 ` [Bug fortran/35997] [4.3/4.4 regression] Used " pinskia at gcc dot gnu dot org
2008-05-05 15:48 ` jsm28 at gcc dot gnu dot org
2008-05-05 17:06 ` burnus at gcc dot gnu dot org
2008-05-13 20:28 ` pault at gcc dot gnu dot org
2008-05-13 20:29 ` pault 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).