From owner-freebsd-hackers Sat Mar 13 15:38:12 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from rt2.synx.com (tech.boostworks.com [194.167.81.239]) by hub.freebsd.org (Postfix) with ESMTP id AFDC514CBF for ; Sat, 13 Mar 1999 15:38:08 -0800 (PST) (envelope-from root@synx.com) Received: from synx.com (rn.synx.com [192.1.1.241]) by rt2.synx.com (8.9.1/8.9.1) with ESMTP id AAA29762; Sun, 14 Mar 1999 00:45:17 +0100 (CET) Message-Id: <199903132345.AAA29762@rt2.synx.com> Date: Sun, 14 Mar 1999 00:37:04 +0100 (CET) From: Remy Nonnenmacher Reply-To: remy@synx.com Subject: Re: 'C' language question To: dennis@etinc.com Cc: hackers@FreeBSD.ORG In-Reply-To: <199903132232.RAA19255@etinc.com> MIME-Version: 1.0 Content-Type: TEXT/plain; CHARSET=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 13 Mar, Dennis wrote: > *reg |= 0x80000000; > > generates a byte OR (ORB instruction) which trashes the register with > gcc 2.9.2....a stupid "optimization" that happens to be wrong in this > case. Just for fun: i couldn't resist to expose you all a real 'optimization' madness of the C compiler of a big (really big) company : (after macros expension) Original : if (A == 0) {...} if ((A == 0 ? *ptr++ : func()) == 7) {...} assembler code generated : if (A == 0) {..} else if (*++ptr == 7) {..} ^^^^^ just to say that 'stupid' seems a little hard in the original message case. RN. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message