From owner-freebsd-hackers Thu Mar 9 11:46:57 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id LAA19813 for hackers-outgoing; Thu, 9 Mar 1995 11:46:57 -0800 Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.97.216]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id LAA19805; Thu, 9 Mar 1995 11:46:55 -0800 Received: (from kargl@localhost) by troutmask.apl.washington.edu (8.6.10/8.6.9) id LAA29261; Thu, 9 Mar 1995 11:40:48 -0800 From: Steven G Kargl Message-Id: <199503091940.LAA29261@troutmask.apl.washington.edu> Subject: optimization is broken for f77 To: freebsd-current@freefall.cdrom.com (FreeBSD Current), freebsd-hackers@freefall.cdrom.com (FreeBSD) Date: Thu, 9 Mar 1995 11:40:48 -0800 (PST) X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 1574 Sender: hackers-owner@FreeBSD.org Precedence: bulk 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 |---------------------|