From owner-freebsd-hackers Sun Jun 15 05:38:54 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id FAA08451 for hackers-outgoing; Sun, 15 Jun 1997 05:38:54 -0700 (PDT) Received: from piggy.mdstud.chalmers.se (root@piggy.mdstud.chalmers.se [129.16.234.10]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id FAA08436 for ; Sun, 15 Jun 1997 05:38:36 -0700 (PDT) Received: from hallgren.se (ip181124.student.gu.se [130.241.181.124]) by piggy.mdstud.chalmers.se (8.8.5/8.7.3) with SMTP id OAA12566; Sun, 15 Jun 1997 14:37:08 +0200 (MET DST) Message-ID: <33A3E123.41C67EA6@mdstud.chalmers.se> Date: Sun, 15 Jun 1997 14:33:39 +0200 From: Tommy Hallgren Organization: FreeBSD X-Mailer: Mozilla 3.01 (X11; I; FreeBSD 2.2.1-RELEASE i386) MIME-Version: 1.0 To: "Serge A. Babkin" CC: hackers@freebsd.org Subject: Re: C optimizer bug ? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi Serge! Sometimes when you turn on optimizations, the compiler decides to cache some data into registers. Loops like while(!flag) {} will be mov eax, flag label: tst eax branch label  instead of label: mov eax, flag tst eax branch label Use the keyword "volatile" to force the loading the contents every time. Maybe this could be your problem? Mvh: Tommy(md6tommy@mdstud.chalmers.se)