Article View: comp.std.c
Article #1361Re: for(;;) vs. while(1) is a draw
From: Richard A. O'Keefe
Date: Thu, 31 May 1990 12:58
Date: Thu, 31 May 1990 12:58
38 lines
2634 bytes
2634 bytes
In article <5927@buengc.BU.EDU>, bph@buengc.BU.EDU (Blair P. Houghton) writes: [ you know what he has been writing ] I want to apologise to Blair Houghton. I have been reading all his postings on this topic, and the only interpretation which suggested itself to me was that he was saying that a compiler could not truthfully be said to conform to the standard unless under certain conditions about claims about optimisation which aren't quite clear to me, it generates _exactly_ the same code for while(1) and for(;;). So I understood his postings in the same sense as Doug Gwyn and the rest. Obviously, I'm misreading him. I _think_ my difficulty lies in seeing what counts as optimisation. For example, if we consider a compiler which generates assembly code, should the labels generated have exactly the same spelling? If the for(;;) code has an extra unused label (it's easy to imagine a dumb compiler planting a jump around nothing to handle expr-3 and then the peep-hole optimiser deleting the jump and leaving the label), does that count as identical code or not? Please, this is serious. I want to know what it is about object code generated under this or that claim about optimisation which the ANSI C standard can govern. I haven't a current copy of the standard, so it may well say all sorts of things, for all _I_ know to the contrary. In particular, given the possibility of "compiling" C by stuffing it through lexical passes alone and executing the token sequence interpretively, how can _any_ compiler writer truthfully claim to be doing "no optimisation" in the sense required? I don't understand this. Who are the compiler writers who are making this claim? > Because I don't like compilers that get ahead of my debugging. Can't disagree with that; on the other hand, when I skip over a procedure call, I'd rather not wait for it too long. Just as long as the compilers don't get too far ahead of _their_ debugging (:-). -- "A 7th class of programs, correct in every way, is believed to exist by a few computer scientists. However, no example could be found to include here."
Technical Details
Message-ID:
<3120@goanna.cs.rmit.oz.au>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!usc!samsung!munnari.oz.au!ditmela!yarra!monu6!minyos!goanna!okReferences:
<5879@buengc.BU.EDU> <3381@auspex.auspex.com> <5905@buengc.BU.EDU> <5927@buengc.BU.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!usc!samsung!munnari.oz.au!ditmela!yarra!monu6!minyos!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.std.c Subject: Re: for(;;) vs. while(1) is a draw Message-ID: <3120@goanna.cs.rmit.oz.au> Date: 31 May 90 12:58:57 GMT References: <5879@buengc.BU.EDU> <3381@auspex.auspex.com> <5905@buengc.BU.EDU> <5927@buengc.BU.EDU> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 38