Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Mar 1995 11:40:48 -0800 (PST)
From:      Steven G Kargl  <kargl@troutmask.apl.washington.edu>
To:        freebsd-current@freefall.cdrom.com (FreeBSD Current), freebsd-hackers@freefall.cdrom.com (FreeBSD)
Subject:   optimization is broken for f77
Message-ID:  <199503091940.LAA29261@troutmask.apl.washington.edu>

next in thread | raw e-mail | index | archive | help
It appears that optimization of Fortran compilations is broken
if the source code contains continuation lines.  I have a code
foo1.f with several continuation lines:

f77 -o foo1 -g foo1.f       [compiles and runs and gives foo1.dat]
f77 -o foo2 -g -O foo1.f    [compiles but dies with SIGFPE] 
f77 -o foo2 -g -O2 foo1.f   [compiles but dies with SIGFPE at same place] 

The guilty lines looks like

            d(1, 2) = (two * fj * fjm1 - xts) * jxl(j)
     &              + four * xl * jxl(jp1)

All variables are declared double precision, and all values are well
within the machine precision.


If I eliminate all continuation lines from the code, I get

f77 -o bar1 -g bar1.f       [compiles and runs and gives bar1.dat]
f77 -o bar2 -g -O bar1.f    [compiles and runs and gives bar2.dat] 
f77 -o bar2 -g -O2 bar1.f   [compiles and runs and gives bar3.dat] 


`diff -c foo1.dat bar?.dat' shows no differences in the output of the 
executables.


On a different note,  I have managed to compile g77-0.5.13 and gcc-2.6.3.

g77 -o goo1 -g foo1.f       [compiles and runs and gives goo1.dat]
g77 -o goo2 -g -O foo1.f    [compiles and runs and gives goo2.dat] 
g77 -o goo2 -g -O2 foo1.f   [compiles but dies and gives goo3.dat] 

`diff -c foo1.dat goo?.dat' shows no differences in the output of the 
executables.

-- 
Steven G. Kargl            | Phone: 206-685-4677 |
Applied Physics Laboratory | Fax:   206-543-6785 |
University of Washington   |---------------------|
1013 NE 40th St            | FreeBSD 2.1-current |
Seattle, WA 98105          |---------------------|



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199503091940.LAA29261>