From owner-freebsd-current Thu Mar 9 16:06:43 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id QAA26749 for current-outgoing; Thu, 9 Mar 1995 16:06:43 -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 QAA26743 for ; Thu, 9 Mar 1995 16:06:41 -0800 Received: (from kargl@localhost) by troutmask.apl.washington.edu (8.6.10/8.6.9) id PAA10760; Thu, 9 Mar 1995 15:57:29 -0800 From: Steven G Kargl Message-Id: <199503092357.PAA10760@troutmask.apl.washington.edu> Subject: Re: optimization is broken for f77 To: joerg_wunsch@uriah.heep.sax.de Date: Thu, 9 Mar 1995 15:57:29 -0800 (PST) Cc: freebsd-current@FreeBSD.org In-Reply-To: <199503092136.WAA08416@uriah.heep.sax.de> from "J Wunsch" at Mar 9, 95 10:36:12 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 1643 Sender: current-owner@FreeBSD.org Precedence: bulk According to J Wunsch: > > As Steven G Kargl wrote: > > > > 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 foo3 -g -O2 foo1.f [compiles but dies with SIGFPE at same place] > > gcc optimization problem. I've also stumpled across it when porting > the acm flight simulator, though acm happens to work when compiled > with -O only. > > Ask Bruce for the details. > Thanks, I found out it was gcc version 2.6.2 problem. I used f2c to generate foo1.c, then tried f2c foo1.f gcc -o foo1 -g foo1.c -lf2c -lm [compiles and runs and gives foo1.dat] gcc -o foo2 -g -O foo1.c -lf2c -lm [compiles but dies with SIGFPE] gcc -o foo3 -g -O2 foo1.c -lf2c -lm [compiles but dies with SIGFPE] Strangely, I remembered that f2c could be invoked to enforce Fortran evalution of expressions, so f2c -krd foo1.f gcc -o foo1 -g foo1.c -lf2c -lm [compiles, runs and gives foo1.dat] gcc -o foo2 -g -O foo1.c -lf2c -lm [compiles, runs and gives foo2.dat] gcc -o foo3 -g -O2 foo1.c -lf2c -lm [compiles but dies with SIGFPE] I've also found that gcc 2.6.3 seems to have fixed this problem. -- 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 |---------------------|