[comp.sys.sgi] Another F77-3.3 Bug

XBR2D96D@DDATHD21.BITNET (Knobi der Rechnerschrat) (06/29/90)

Hallo,

  I've another F77 3.3 bug. As it seems very severe I post It to the list
and not to Calvin Vu (SGI) alone. If you compile/link/run the appended
program t1.f under 3.3 you will get the following two lines of output:

1 T
bla is false

  As anybody can see, bla IS in fact TRUE, so the program lies. In the
release notes 3.3 FORTRAN 77 is stated:

(SCR 6822): Printing out LOGICAL*1 values results in 0/1 being printed
            instead of F/T.

  That is the cause for the '1 T' output line. Unfortunatelly there seems
to be an unknown problem with using LOGICAL*1 in IF statements. As this is
absolutely deadly for programs using LOGICAL*1 (e.g. for storage saving)
I feel this should be known to the "public" and fixed as soon as possible.

Regards
Martin Knoblauch

TH-Darmstadt
Physical Chemistry 1
Petersenstrasse 20
D-6100 Darmstadt, FRG

BITNET: <XBR2D96D@DDATHD21>

PS: Dear Calvin, sorry for posting this to everybody, but I feel it is
    important news and I'm also not sure whether my mails make the way
    to SGI directly.
----------------------------t1.f----------------------------------------------
        program bug_6822
c
        logical*1 bla
        logical  bla4
c
        bla  = .true.
        bla4 = .true.
        write(*,*) bla,bla4
c
        if(.not.bla)  write(*,*) 'bla is false'
        if(.not.bla4) write(*,*) 'bla4 is false'
c
        end
---------------------------end of t1.f-----------------------------------------

calvin@dinkum.sgi.com (Calvin H. Vu) (07/03/90)

In article <9006291416.aa20103@VGR.BRL.MIL> XBR2D96D@DDATHD21.BITNET (Knobi der Rechnerschrat) writes:
>        program bug_6822
>c
>        logical*1 bla
>        logical  bla4
>c
>        bla  = .true.
>        bla4 = .true.
>        write(*,*) bla,bla4
>c
>        if(.not.bla)  write(*,*) 'bla is false'
>        if(.not.bla4) write(*,*) 'bla4 is false'
>c
>        end
>---------------------------end of t1.f-----------------------------------------

	This is introduced in MIPS 2.0 release to allow logical*1 variables
to contain integer*1 values (for VMS compatibility).  There was an oversight 
in the implementation that caused integer operations on the logical*1
variables.  This has been fixed in the 3.3 maintenance release (and in MIPS
2.10 release).

Sorry about the inconvenience.
- calvin
-----------------------------------------------------------------------------
Calvin H. Vu			   | "We are each of us angels with only one
Silicon Graphics Computer Systems  | wing.  And we can only fly embracing
calvin@sgi.com   (415) 962-3679	   | each other."