Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Mar 1999 00:37:04 +0100 (CET)
From:      Remy Nonnenmacher <remy@synx.com>
To:        dennis@etinc.com
Cc:        hackers@FreeBSD.ORG
Subject:   Re: 'C' language question
Message-ID:  <199903132345.AAA29762@rt2.synx.com>
In-Reply-To: <199903132232.RAA19255@etinc.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903132345.AAA29762>