From owner-freebsd-hackers Sun Jun 15 11:48:52 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id LAA20667 for hackers-outgoing; Sun, 15 Jun 1997 11:48:52 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id LAA20662 for ; Sun, 15 Jun 1997 11:48:50 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id LAA16658; Sun, 15 Jun 1997 11:39:16 -0700 From: Terry Lambert Message-Id: <199706151839.LAA16658@phaeton.artisoft.com> Subject: Re: C optimizer bug ? To: babkin@hq.icb.chel.su (Serge A. Babkin) Date: Sun, 15 Jun 1997 11:39:15 -0700 (MST) Cc: jkh@time.cdrom.com, hackers@FreeBSD.ORG In-Reply-To: <199706150136.HAA07646@hq.icb.chel.su> from "Serge A. Babkin" at Jun 15, 97 07:36:45 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Okay, here is the description: The function scsi_done() must check > whether xs->bp is zero and then depending on it call biodone() Declare this variable volitile. You are probably suffering from overambitious ANSI register optimization, where the value being tested is loaded into a register and never reloaded (there's actually no excuse for this, given that the compiler can determine loop scoping and see from that whether or not the optimization would fail). Sun's ANSI C and othes have similar problems. Probably the success depends upon whether the value is initially zero or not. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.