tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Holger Bauer <bauer () itsm ! uni-stuttgart ! de>
To: tru64-unix-managers
Subject: Fortran 90 and check_bounds
Date: Tue, 20 Jun 2000 07:43:36 +0000	[thread overview]
Message-ID: <96148706719457.tru64-unix-managers.marc@archive.invalid> (raw)

The following message is a courtesy copy of an article
that has been posted to comp.lang.fortran as well.

Suppose the following code (with NB(L)=0)

     ....(L,MAXL,NB,IBC)
INTEGER :: NB(MAXL),IBC(6)
IF(NB(L).GT.0.AND.IBC(L).EQ.3)THEN
...
ELSE
...
ENDIF

The code does NOT run on Tru64Unix and SGI IRIX64 if the
check_bounds option is set AND NB(L) is equal to zero.
(using 5.3 Version of the Compaq compiler)

It is clear to me, that 0 then is NOT a valid subscript for
the array IBC (IBC(0)). However, my understanding of Fortran
(and other languages) was that logical expressions with the
same prioriy are parsed from left to right and the compiler
will NOT evaluate the remaining expressions once the whole
expression will already be .FALSE. (as it will be with the
NB(L).GT.0.AND. subexpression.

Since we have many of these expressions in our code (and
this was NEVER a problem with F77 with check_bounds) I ask
myself if this is a compiler bug or this is according to the
F90 specifications.

Regards,

Holger

 ------------------------------------------------
|  Holger Bauer     | Univ. of Stuttgart, ITSM   |
 ------------------------------------------------

                 reply	other threads:[~2000-06-20  7:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox