From owner-freebsd-current@FreeBSD.ORG Mon Jan 30 12:54:48 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F05416A420 for ; Mon, 30 Jan 2006 12:54:48 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BA1C43D45 for ; Mon, 30 Jan 2006 12:54:48 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.12.11) with ESMTP id k0UCslPF021325 for ; Mon, 30 Jan 2006 04:54:47 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id k0UCslI0021324 for freebsd-current@freebsd.org; Mon, 30 Jan 2006 04:54:47 -0800 (PST) (envelope-from rizzo) Date: Mon, 30 Jan 2006 04:54:47 -0800 From: Luigi Rizzo To: freebsd-current@freebsd.org Message-ID: <20060130045447.A20935@xorpc.icir.org> References: <20060129050435.A5945@xorpc.icir.org> <200601301212.k0UCCnu6054149@lurza.secnetix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200601301212.k0UCCnu6054149@lurza.secnetix.de>; from olli@lurza.secnetix.de on Mon, Jan 30, 2006 at 01:12:49PM +0100 Subject: Re: for review: sys/dev/md/md.c patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2006 12:54:48 -0000 On Mon, Jan 30, 2006 at 01:12:49PM +0100, Oliver Fromme wrote: > Luigi Rizzo wrote: > > just discovered, trying to resurrect picobsd on -current, > > that the compiler in 6.x/7.x has become smart and, at least > > with the default compilation flags, will optimize out > > the "end_mfs_root" string from the object. > > Shouldn't it be sufficient to declare the string as volatile? > That should prevent it from being optimized by the compiler. maybe. but packing both into the same struct also solves the issue of compiler potentially rearranging the variables in memory, and since we want them contiguous, the approach i suggested is probably more appropriate (with compilers becoming smarter and smarter, that is...) cheers luigi > (I'm not questioning your solution, mind you. I just wonder > if "volatile" would do the job. So far I've used volatile > for things like sig_atomic_t only.) > > Best regards > Oliver > > -- > Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing > Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd > Any opinions expressed in this message may be personal to the author > and may not necessarily reflect the opinions of secnetix in any way. > > "When your hammer is C++, everything begins to look like a thumb." > -- Steve Haflich, in comp.lang.c++ > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"