From owner-freebsd-current Fri Jul 21 3: 4:56 2000 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 0722037B6BA for ; Fri, 21 Jul 2000 03:04:52 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.8.7/8.8.7) with ESMTP id UAA07297; Fri, 21 Jul 2000 20:04:18 +1000 Date: Fri, 21 Jul 2000 20:04:20 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: John Polstra Cc: hm@hcs.de, current@FreeBSD.ORG Subject: Re: kernel compile failure without -O option In-Reply-To: <200007200231.TAA15177@vashon.polstra.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 19 Jul 2000, John Polstra wrote: > In article <20000719144614.7FE52483D@hcswork.hcs.de>, > Hellmuth Michaelis wrote: > > > > In the process of tracing down the problem of the kernel panic when booting > > a kernel with pcvt enabled, i tried to compile a kernel without the -O > > option to gcc and got this compile failure (sources from 18.7.2000 9:00 MET): > > > > cc -c -pipe -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual > > -fformat-extensions -ansi -nostdinc -I- -I. -I../.. -I../../../include > > -D_KERNEL -include opt_global.h -elf -mpreferred-stack-boundary=2 > > -fomit-frame-pointer ../../i386/i386/atomic.c > > In file included from ../../i386/i386/atomic.c:47: > > machine/atomic.h: In function `atomic_set_char': > > machine/atomic.h:106: inconsistent operand constraints in an `asm' > > machine/atomic.h: In function `atomic_clear_char': > > machine/atomic.h:107: inconsistent operand constraints in an `asm' > [...] > > I have seen that same problem recently in a slightly different > context. After staring at the code for a very long time, I could > only conclude that the problem was a bug in gcc. Me too :-). I didn't reply to John's private mail about this (sorry), partly because the problem seemed to be an old one that I wasn't able to solve before. The "0" construct apparently doesn't work even with -O for gcc <= 2.8, so atomic.h is ifdefed to not use it for non-current gcc's, although it is strictly required for the input-output operands in atomic.h. There is also a problem with gcc's handling of volatile objects in atomic.h (it just pessimizes them). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message