Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* BEWARE of DECunix f77 3.8 compiler!
@ 1995-09-12  4:00 Walter Brueckner
  1995-09-13  4:00 ` Brian McIlwrath
  0 siblings, 1 reply; 7+ messages in thread
From: Walter Brueckner @ 1995-09-12  4:00 UTC (permalink / raw)


Beware of DEC unix f77 3.8 !
---------------------------

The very simple program below ("uhtoc" ouf of the cern library)
is compiled to incorrect code by f77 3.8, as soon as any
optimization level higher than -O1 is selected (e.g. -O2 ,-O3 or
-O4).
Since the routine is rather simple it indicates a serious
malfunction of the compiler and/or optimizer that almost
certainly will affect other code as well.
I have informed Digital and I am waiting for a bug fix.

Walter Brueckner
Cern


Here is the routine:

CDECK  ID>, UHTOC.
      SUBROUTINE UHTOC (MS,NPW,MT,NCH)
C
C CERN PROGLIB# M409    UHTOC           .VERSION KERNFOR  4.21  890323
C ORIG. 10/02/89  JZ
C
      DIMENSION    MS(99)
      CHARACTER    MT*99
 
      PARAMETER   (NCHAPW=4)
      CHARACTER    CHWORD*(NCHAPW)
      INTEGER      IWORD
      EQUIVALENCE (IWORD,CHWORD)
 
 
      IF   (NCH)             91, 29, 11
   11 IF (NPW.LE.0)          GO TO 91
      IF (NPW.EQ.1)          GO TO 21
      IF (NPW.LT.NCHAPW)     GO TO 31
 
C--------          NPW = maximum
 
      JT     = 0
      NWS    = NCH / NCHAPW
      NTRAIL = NCH - NWS*NCHAPW
 
      DO 14  JS=1,NWS
      IWORD  = MS(JS)
      MT(JT+1:JT+NCHAPW) = CHWORD
   14 JT  = JT + NCHAPW
 
      IF (NTRAIL.EQ.0)       RETURN
 
      IWORD = MS(NWS+1)
      MT(JT+1:JT+NTRAIL) = CHWORD(1:NTRAIL)
      RETURN
 
C--------          NPW = 1
C--                equivalent to 'CALL UH1TOC(MS,MT,NCH)'
 
   21 DO 24  JS=1,NCH
      IWORD  = MS(JS)
      MT(JS:JS) = CHWORD(1:1)
   24 CONTINUE
   29 RETURN
 
C--------          NPW = 2 ...
 
   31 JT     = 0
      NWS    = NCH / NPW
      NTRAIL = NCH - NWS*NPW
 
      DO 34  JS=1,NWS
      IWORD  = MS(JS)
      MT(JT+1:JT+NPW) = CHWORD(1:NPW)
   34 JT  = JT + NPW
 
      IF (NTRAIL.EQ.0)       RETURN
 
      IWORD = MS(NWS+1)
      MT(JT+1:JT+NTRAIL) = CHWORD(1:NTRAIL)
      RETURN
 
   91 CALL ABEND
      END



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

end of thread, other threads:[~1995-09-21  4:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-09-12  4:00 BEWARE of DECunix f77 3.8 compiler! Walter Brueckner
1995-09-13  4:00 ` Brian McIlwrath
1995-09-13  4:00   ` Steve Lionel
     [not found]   ` <1995Sep18.143529.7809@cronkite.res.utc.com>
1995-09-19  4:00     ` Steve Lionel
1995-09-19  4:00   ` Signals (was Re: BEWARE of DECunix f77 3.8 compiler!) Juergen Fuhrmann
1995-09-20  4:00     ` Steve Lionel
1995-09-21  4:00       ` 0 Bradley_Pete x9338 b-000

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