public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34260]  New: present returns wrong value of optional variables
@ 2007-11-28  9:37 vahtras at pdc dot kth dot se
  2007-11-28 10:33 ` [Bug fortran/34260] " terry at chem dot gu dot se
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: vahtras at pdc dot kth dot se @ 2007-11-28  9:37 UTC (permalink / raw)
  To: gcc-bugs

the PRESENT test of an optional variable returns TRUE in both of these calls

$ cat c.F; gfortran c.F ; ./a.out
      PROGRAM MAIN
      REAL A
      INTEGER I
      CALL SUB(A,I)
      CALL SUB(A)
      END

      SUBROUTINE SUB(A,I)
      REAL :: A
      INTEGER, OPTIONAL :: I
      IF (PRESENT(I)) THEN
         PRINT *,'YES'
      ELSE
         PRINT *,'NO'
      END IF
      END
 YES
 YES

c.f intel gives
$ ifort c.F ; ./a.out
 YES
 NO

gfortran behaves correctly with an explicit INTERFACE, but that
should not be required (as far as I know)

Olav


-- 
           Summary: present returns wrong value of optional variables
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vahtras at pdc dot kth dot se
 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=34260


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

end of thread, other threads:[~2010-07-18 21:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-28  9:37 [Bug fortran/34260] New: present returns wrong value of optional variables vahtras at pdc dot kth dot se
2007-11-28 10:33 ` [Bug fortran/34260] " terry at chem dot gu dot se
2007-11-28 13:22 ` vahtras at kth dot se
2007-11-28 13:54 ` [Bug fortran/34260] Give warning if procedure with implicit interface is called with different arguments burnus at gcc dot gnu dot org
2010-05-01 20:35 ` dfranke at gcc dot gnu dot org
2010-05-25 18:10 ` dfranke at gcc dot gnu dot org
2010-05-25 18:11 ` dfranke at gcc dot gnu dot org
2010-07-18 20:50 ` dfranke at gcc dot gnu dot org
2010-07-18 21:15 ` dfranke 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).