Re: f77 on SUN vs. on HPRISC'S

adams@fb0431.mathematik.th-darmstadt.de (Hans Adams)
Wed, 14 Dec 1994 01:22:19 GMT

          From comp.compilers

Related articles
f77 on SUN vs. on HPRISC'S khire@cae.wisc.edu (1994-12-03)
Re: f77 on SUN vs. on HPRISC'S przemek@rrdjazz.nist.gov (1994-12-05)
Re: f77 on Sun vs. on HPRISC's harrist@hsd.utc.com (1994-12-07)
Re: f77 on SUN vs. on HPRISC'S adams@fb0431.mathematik.th-darmstadt.de (1994-12-14)
Re: f77 on Sun vs. on HPRISC's jan@neuroinformatik.ruhr-uni-bochum.de (1994-12-16)
Re: f77 on Sun vs. on HPRISC's shankar@sgi.com (1994-12-21)
| List of all articles for this month |

Newsgroups: comp.compilers,comp.lang.fortran
From: adams@fb0431.mathematik.th-darmstadt.de (Hans Adams)
Keywords: Fortran
Organization: TH-Darmstadt
References: 94-12-034
Date: Wed, 14 Dec 1994 01:22:19 GMT

khire@cae.wisc.edu (Milind Khire) writes:


> Hello Everybody:
> I have a FORTRAN code originally written for VAX-VMS, but it is
> compatible with SUN UNIX. But if I try to run it on HPRISC's it compiles
> fine but gives me completely garbage numbers in output. If anyone
> knows what are the exact differences in FORTRAN (f77) compilers or
> systems for SUN and HPRISC, I would really appreciate your advice to
> resolve this problem.


HP-UX F77 seems to be a strange mixture of Fortran 90 and Fortran 77.


Storage handling seems rather different to other f77 compilers,
IEEE-floating point will be enabled by a linker (!) switch ....
But first of all, some compiler switches regarded "useful":


Paraphrased from the manual :


  +E7 : use static storage to save addresses of arguments
              to be passed to functions and subroutines


  +K : "Forces static storage for all local variables.
This provides a convenient path for importing [!]
FORTRAN 66 and FORTRAN 77 programs ...."


  -C: bounds check !!!


  +FPVZOU: trap on ivalid fp ops, divide by zero, overflow, underflow


But, let's have a lopok at two programs, exposing strange behaviour
=====================================================================


C
This program was taken from a test lib.
c program to test bug
            fred=10.0E-12
C
C Expression in brackets should be evaluated first,
C no overflow / cutoff should occur.
C
            fred=(fred*1000000)*500000
            george=10.0E-12
            george=(george*1000000.0)*500000.0
            print *, fred,george
            end


=======================================================================
C by Prof. Spellucci
            double precision a(1000),maxa,mina
            integer i,n
            maxa=-1.0d0
            mina=2.0d0
            a(1)=0.d0
            write(*,*) 'eingabe n='
            read(*,*) n
            do i=1,n
                a(i)=dble(i-1)/n
            enddo
            do i=1,n
                maxa=max(maxa,a(i))
                mina=min(mina,a(i))
            enddo
            write(*,*) 'test:',maxa,mina,(a(i),i=1,n)
            stop
            end
C... compile: f77 -oexe +OP3 file.f
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.