Article View: comp.unix.programmer
Article #3661Re: gcc -O2 bug
From: Dan Pop
Date: Thu, 08 Aug 1996 00:00
Date: Thu, 08 Aug 1996 00:00
18 lines
1513 bytes
1513 bytes
In <3209b0dc.0@epflnews.epfl.ch> Thomas.Wolf@di.epfl.ch (Thomas Wolf) writes: >5. How your compiler determined that 'time' does not return something > that results in 'flag' == 0 is a mystery to me. Maybe it didn't and > this is just its version of undefined behavior? Nope. The compiler didn't determine anything about time(), it simply put the test _before_ the loop and generated an infinite loop. That is what any decent optimizing compiler is supposed to do in such a case, since the expression being tested is a loop invariant. Dan -- Dan Pop CERN, CN Division Email: Dan.Pop@cern.ch Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
Technical Details
Message-ID:
<danpop.839521193@news.cern.ch>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<4ubnat$75u@freeside.fc.net> <3209b0dc.0@epflnews.epfl.ch>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,7d30cae02ba9b089 X-Google-Attributes: gid11318c,public X-Google-Thread: 10c696,7d30cae02ba9b089 X-Google-Attributes: gid10c696,public X-Google-Thread: fc89c,7d30cae02ba9b089 X-Google-Attributes: gidfc89c,public X-Google-Thread: 1014db,7d30cae02ba9b089 X-Google-Attributes: gid1014db,public From: Dan.Pop@cern.ch (Dan Pop) Subject: Re: gcc -O2 bug Date: 1996/08/08 Message-ID: <danpop.839521193@news.cern.ch> X-Deja-AN: 172939853 sender: news@news.cern.ch (USENET News System) x-nntp-posting-host: ues5.cern.ch references: <4ubnat$75u@freeside.fc.net> <3209b0dc.0@epflnews.epfl.ch> organization: CERN European Lab for Particle Physics keywords: gcc bug O2 newsgroups: comp.unix.programmer,gnu.gcc.help,comp.os.linux.development.apps,comp.lang.c