Date: 23 Jan 2001 15:10:35 -0500 From: Randell Jesup <rjesup@wgate.com> To: obrien@FreeBSD.ORG Cc: Randell Jesup <rjesup@wgate.com>, freebsd-stable@FreeBSD.ORG Subject: Re: "Malloc type lacks magic" show-stopper solved Message-ID: <ybud7deqbb8.fsf@jesup.eng.tvol.net.jesup.eng.tvol.net> In-Reply-To: "David O'Brien"'s message of "Sun, 5 Nov 2000 11:39:07 -0800" References: <Pine.BSF.4.30.0011021247480.81655-100000@taygeta.dbai.tuwien.ac.at> <ybubsvyfhze.fsf@jesup.eng.tvol.net.jesup.eng.tvol.net> <20001105113907.B2656@dragon.nuxi.com>
next in thread | previous in thread | raw e-mail | index | archive | help
"David O'Brien" <obrien@FreeBSD.ORG> writes: >On Thu, Nov 02, 2000 at 11:37:09AM -0500, Randell Jesup wrote: >> -O2 should work. I've never seen a bug with -O2 code generation >> from GCC (not that they can't happen, of course). Most bugs I've seen in >> my career with optimization levels were actually timing holes in the >> source code, where someone was accessing a shared resource and counting >> on ordering/etc, or bugs with accessing hardware registers where structures >> weren't properly marked volatile. >> >> If there's a problem, find it and report it. IMHO. > >Love to, but its often too hard -- unless handing over an entire kernel >source directory as the test case showing the bug is acceptable. (Response to an old article) The point I was trying to make was that my first assumption would be that the bug is due to race conditions or missing 'volatile' statements, probably in hardware drivers or code that interacts with CPU hardware (page tables, etc). Perhaps it's a holdover (in habits) from the days before useful optimizers in Unix C compilers. When one typically runs/compiles unoptimized code (or minimally optimized code), it's easy to get out of the habit of using volatile. (Witness all the 'register' statements in Unix kernels, which almost any compiler worth it's salt should ignore.) Now, certainly there are LOTS of volatile statements in the kernel - but it only takes a few (or even one) missing volatile to leave you in danger from optimizers. And just because -O happens to work doesn't mean there isn't a hole - it may just be smaller, or it may show up the next time the compiler is revved, or if someone uses a different compiler, or ports to a different architecture. And, as I mentioned, perhaps it's a -O2 compiler bug, in which case I want to see it fixed anyways. It wouldn't surprise me if there's only one or two problems (in the kernel or compiler). IMHO. -- Randell Jesup, Worldgate Communications, ex-Scala, ex-Amiga OS team ('88-94) rjesup@wgate.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ybud7deqbb8.fsf>