------- Comment #1 from jv244 at cam dot ac dot uk  2007-10-25 17:33 -------
this is a slightly modified testcase, which g95, NAG f95, IBM xlf90, ifort,
pgf90 all compile & link while it fails to compile with gfortran. The error
message by gfortran (Global name 'setbd' at (1) is already being used as a
FUNCTION at (2)) suggests gfortran has a problem.

Interestingly, it returns 1 with g95, NAG f95, IBM xlf90, pgf90 and 0 with
ifort.

MODULE ksbin1_aux_mod
 CONTAINS
  SUBROUTINE nxtstg()
    INTEGER :: i
    INTEGER :: setbd
    i = setbd()
    write(6,*) i
  END SUBROUTINE nxtstg
  FUNCTION binden()
    INTEGER :: binden
    INTEGER :: setbd
    binden = 0
  ENTRY setbd()
    setbd = 0
  END FUNCTION binden
END MODULE ksbin1_aux_mod
PROGRAM test
  USE ksbin1_aux_mod
  CALL nxtstg()
END PROGRAM test
INTEGER FUNCTION setbd()
  setbd=1
END FUNCTION setbd

A simpler testcase is:
MODULE M1
CONTAINS
 SUBROUTINE S2()
    ENTRY E2()
    write(6,*) 'C'
 END SUBROUTINE S2
END MODULE M1

SUBROUTINE S2()
    ENTRY E2()
    write(6,*) 'E'
END SUBROUTINE S2


-- 

jv244 at cam dot ac dot uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |32834
              nThis|                            |
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2007-10-25 17:33:09
               date|                            |


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

Reply via email to