🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2297

Re: use of the break statement

#2297
From: Michael J Zehr
Date: Fri, 15 Mar 1996 03:15
26 lines
1831 bytes
In article <4i97ht$8gb@solutions.solon.com> Andrew Dalgleish <andrewd@axonet.com.au> writes:
>I have found the magazine. In the December 1995 issue of C/C++ Users 
>Journal is an article entitled "Another Slap at Lowly goto".
>The authors compared the assembler output of 9 compilers, only Microsoft 
>C 7.0 optimizes loops built from goto's. All the compilers did worse 
>than I would have expected.
>
>The authors came to the wrong conclusion - don't criticize the compiler, 
>stay away from goto's. IMO this amounts to shooting the messenger.

I would disagree with this.  The compiler writers should allocate their
resources to optimize best for the most common code they compile.

If someone wants to obscure what they are doing from the compiler
(writing a loop with a goto instead of saying what they mean), then
that's their choice.  But they shouldn't expect everyone else who is
trying to be clear in communicating with the compiler to pay higher
prices so the compiler writers can allocate more resources to a rare and
avoidable circumstance.

It also slows the compilations down in the cases when someone is using a
goto when it isn't a simple loop they're writing -- the compiler would
have to check to determine the semantics to see if it could apply its
optimzations.

-michael j zehr
Technical Details
Message-ID: <4ianbt$h8m@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4hqedf$1m0@solutions.solon.com> <4i2k0n$8jd@solutions.solon.com> <4i97ht$8gb@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: tada@athena.mit.edu (Michael J Zehr)
Newsgroups: comp.lang.c.moderated
Subject: Re: use of the break statement
Date: 14 Mar 1996 21:15:09 -0600
Organization: Massachusetts Institute of Technology
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4ianbt$h8m@solutions.solon.com>
References: <4hqedf$1m0@solutions.solon.com> <4i2k0n$8jd@solutions.solon.com> <4i97ht$8gb@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com