Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jun 1997 09:30:11 +0600 (ESD)
From:      "Serge A. Babkin" <babkin@hq.icb.chel.su>
To:        terry@lambert.org (Terry Lambert)
Cc:        jkh@time.cdrom.com, hackers@FreeBSD.ORG
Subject:   Re: C optimizer bug ?
Message-ID:  <199706160330.JAA24558@hq.icb.chel.su>
In-Reply-To: <199706151839.LAA16658@phaeton.artisoft.com> from "Terry Lambert" at Jun 15, 97 11:39:15 am

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> > 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.

xs->bp does not change during the operation, it is initialized before
calling the SCSI code. I tried to compile the kernel with -C -fvolatile
that must declare all values accessed by pointers as volatile
but this given no positive effect. I tried -fvolatile-global
flag too but the kernel refuses to compile with it at all.
The GCC version is 2.6.3. I'm going to study the produced code.

-SB



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