Article View: comp.lang.c.moderated
Article #2433Re: use of the break statement
From: Dale Johannesen
Date: Fri, 29 Mar 1996 12:08
Date: Fri, 29 Mar 1996 12:08
22 lines
1872 bytes
1872 bytes
In article <4ja3tl$pd6@solutions.solon.com>, tanmoy@qcd.Lanl.GOV (Tanmoy Bhattacharya) writes: |> |> If I were designing a compiler, why should I spend time and effort |> writing complicated code to recognize a quintessentially bad |> programming construct? In this case, it turns out that the loop is |> easy to recognize, and many compilers will probably do so: but this is |> a very specific case. OTOH, compilers for languages that don't have such nice structured constructs, like Fortran, do a better job of recognizing oddly-formed loops, because they have to. So, if you must program with goto's, find a C compiler whose back end is in common with a Fortran compiler. (Tutorial for those who didn't understand "back end": many (most?) compilers these days are divided into a "front end" (FE) and "back end" (BE). The language-specific FE parses the language and produces an intermediate language (IL) which is read by the target-machine-specific BE. If the IL is defined carefully, FE's for multiple languages can be connected to BE's for multiple target machines, and you get several compilers for the price of one. Most optimizations are done in the BE. More recent compilers sometimes add a "middle end" that does optimizations independent of both language and target machine.)
Technical Details
Message-ID:
<4jgjsb$sb8@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4hqedf$1m0@solutions.solon.com> <4i2k0n$8jd@solutions.solon.com> <4i97ht$8gb@solutions.solon.com> <4ianbt$h8m@solutions.solon.com> <4ja3tl$pd6@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: dale@hal.com (Dale Johannesen) Newsgroups: comp.lang.c.moderated Subject: Re: use of the break statement Date: 29 Mar 1996 06:08:43 -0600 Organization: HAL Computer Systems, Inc. Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4jgjsb$sb8@solutions.solon.com> References: <4hqedf$1m0@solutions.solon.com> <4i2k0n$8jd@solutions.solon.com> <4i97ht$8gb@solutions.solon.com> <4ianbt$h8m@solutions.solon.com> <4ja3tl$pd6@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com