RE: possibly related data point - (was) Re: Current Broken!
On Fri, 8 Dec 2000, John Baldwin wrote: > On 08-Dec-00 [EMAIL PROTECTED] wrote: > > > > John, > > > > I'm not a constraints expert either, but I noticed that when I try to > > build a kernel WITHOUT any optimization, I get a failure in > > > > /usr/src/sys/i386/atomic.h . > > Compiling a kernel with anything but -O for optimization is not supported. gcc > has produced buggy code for the -O0 case in the past. -O0 (or plain cc without -O) is supposed to work, but no one cares enough about it to fix it every day. Fixing has been pending for many days now. My oldest saved mail about it is dated 21 July 2000, but ISTR discussing it last year. Bruce To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: possibly related data point - (was) Re: Current Broken!
On Thu, 7 Dec 2000 [EMAIL PROTECTED] wrote: > I'm not a constraints expert either, but I noticed that when I try to > build a kernel WITHOUT any optimization, I get a failure in > > /usr/src/sys/i386/atomic.h . > > # make atomic.o > cc -c -O0 -pipe -Wall -Wredundant-decls -Wnested-externs > ... > /usr/src/sys/i386/i386/atomic.c > In file included from /usr/src/sys/i386/i386/atomic.c:48: > machine/atomic.h: In function `atomic_set_char': > machine/atomic.h:178: inconsistent operand constraints in an `asm' > with any optimization, eg -O, there is _NO_ error. Makes me think the optimizer > is optimizing out the offending contraints. Ouch. Probably not what was intended. > > Maybe this is what's biting you ? This is sort of the opposite of the bug in . It is believed to be caused by using the operand-number constraints (e.g., "(0)") to declare input-output operands in . Input-output operands and/or these constraints apparently never worked right until a recent versions of gcc introduced the "+" contraint to declare input-output operations properly. uses the new constraint. The problem seems to be that "+" contraints don't work right either. The following kludge fixes compilation of cam_periph.c: diff -c2 mutex.h~ mutex.h *** mutex.h~Sun Dec 10 19:28:53 2000 --- mutex.h Sun Dec 10 23:50:21 2000 *** *** 171,174 --- 176,180 \ __asm __volatile ( \ + " movl$" _V(MTX_UNOWNED) ",%%eax;"\ " " MPLOCKED "" \ " cmpxchgl %4,%0;"/* try easy rel */ \ *** *** 181,185 "# exitlock_norecurse"\ : "+m" (mtxp->mtx_lock),/* 0 */ \ ! "+a" (_tid) /* 1 */ \ : "gi" (type), /* 2 (input) */ \ "g" (mtxp), /* 3 */ \ --- 187,191 "# exitlock_norecurse"\ : "+m" (mtxp->mtx_lock),/* 0 */ \ ! "=&a" (_tid) /* 1 */ \ : "gi" (type), /* 2 (input) */ \ "g" (mtxp), /* 3 */ \ This bug seems to have been encountered before -- I copied this inferior code from the function before the one that doesn't compile. Several other functions in also use it. Bruce To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
RE: possibly related data point - (was) Re: Current Broken!
On 08-Dec-00 [EMAIL PROTECTED] wrote: > > I hit on it by accident (I normally compile with -O). That said, your > claim that gcc with no optimization generates incorrect code is > kind of counter-intuitive, wouldn't you say ? I've seen it do weird things with -O0 (mostly with C++). :) It's just another program. Nothing is keeping it from having bugs. :) > I think you missed my point, I was just illustrating that optimizer seems > to affect (in my case apparently negate) the processing of constraints. I am back now to thinking that it is a gcc bug in the -O case now as well. The constraings I removed were in fact valid, so I've put them back in, but just disabled the macros for now until gcc is fixed. > What you take from that is up to you - I was just trying to be helpful :) Sorry if I came across as if I was biting your head off, that was not the intent. > Cheers, > > A. -- John Baldwin <[EMAIL PROTECTED]> -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.Baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Current Locking up... Re: possibly related data point - (was) Re: Current Broken!
-CURRENT as of yesterday was still causing my system to lock (with 'make -j8 world'). Lock=no possibility of debugger. I have two of these systems and they behave identically. If someone with lots more debugging experience would benefit from borrowing one of the machines I'd happily send it to you. I'd really like to be use SMP stabily. -Steve - Original Message - From: "John Baldwin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; "Andrew [SKY:ET95:EXCH]" <[EMAIL PROTECTED]> Sent: Friday, December 08, 2000 1:49 PM Subject: RE: possibly related data point - (was) Re: Current Broken! > > On 08-Dec-00 [EMAIL PROTECTED] wrote: > > > > I hit on it by accident (I normally compile with -O). That said, your > > claim that gcc with no optimization generates incorrect code is > > kind of counter-intuitive, wouldn't you say ? > > I've seen it do weird things with -O0 (mostly with C++). :) It's just another > program. Nothing is keeping it from having bugs. :) > > > I think you missed my point, I was just illustrating that optimizer seems > > to affect (in my case apparently negate) the processing of constraints. > > I am back now to thinking that it is a gcc bug in the -O case now as well. The > constraings I removed were in fact valid, so I've put them back in, but just > disabled the macros for now until gcc is fixed. > > > What you take from that is up to you - I was just trying to be helpful :) > > Sorry if I came across as if I was biting your head off, that was not the > intent. > > > Cheers, > > > > A. > > -- > > John Baldwin <[EMAIL PROTECTED]> -- http://www.FreeBSD.org/~jhb/ > PGP Key: http://www.Baldwin.cx/~john/pgpkey.asc > "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ > > > To Unsubscribe: send mail to [EMAIL PROTECTED] > with "unsubscribe freebsd-current" in the body of the message > To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
RE: possibly related data point - (was) Re: Current Broken!
I hit on it by accident (I normally compile with -O). That said, your claim that gcc with no optimization generates incorrect code is kind of counter-intuitive, wouldn't you say ? I think you missed my point, I was just illustrating that optimizer seems to affect (in my case apparently negate) the processing of constraints. What you take from that is up to you - I was just trying to be helpful :) Cheers, A. +-- | Andrew Atrens Nortel Networks, Ottawa, Canada. | | All opinions expressed are my own, not those of any employer. | --+ Berkeley had what we called "copycenter", which is "take it down to the copy center and make as many copies as you want". -- Kirk McKusick +----+ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
RE: possibly related data point - (was) Re: Current Broken!
On 08-Dec-00 [EMAIL PROTECTED] wrote: > > John, > > I'm not a constraints expert either, but I noticed that when I try to > build a kernel WITHOUT any optimization, I get a failure in > > /usr/src/sys/i386/atomic.h . Compiling a kernel with anything but -O for optimization is not supported. gcc has produced buggy code for the -O0 case in the past. -- John Baldwin <[EMAIL PROTECTED]> -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.Baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message