Loop Optimizations and Gotos

jra@gensym.com (Jim Allard)
Wed, 8 Nov 1995 16:03:54 GMT

          From comp.compilers

Related articles
Loop Optimizations and Gotos jra@gensym.com (1995-11-08)
Re: Loop Optimizations and Gotos burley@cygnus.com (1995-11-12)
Loop Optimizations and Gotos dave@occl-cam.demon.co.uk (Dave Lloyd) (1995-11-12)
Re: Loop Optimizations and Gotos cliffc@ami.sps.mot.com (1995-11-13)
Re: Loop Optimizations and Gotos cdg@nullstone.com (1995-11-13)
Re: Loop Optimizations and Gotos faiman@zko.dec.com (1995-11-16)
Re: Loop Optimizations and Gotos hrubin@stat.purdue.edu (1995-11-17)
[10 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: jra@gensym.com (Jim Allard)
Keywords: C, optimize, question
Organization: Gensym
Date: Wed, 8 Nov 1995 16:03:54 GMT

We're writing a tool that will automatically generate C code which
will be compiled on UNIX, VMS, and NT platforms. The source
lanaguage we're translating from contains looping constructs whose
implementation most directly leads to a translation approach that
uses GOTO statements instead of FOR or WHILE loops. In the vast
majority of cases, these gotos form simple looping paths, with an IF
statement conditioning a GOTO back to a label earlier in the same
enclosing compound statement. With some work we can identify these
loops by a pattern matching scheme that will get most of the commonly
used loop idioms and then translate those as FOR or WHILE loops.

We've had a debate here about whether this work is worth it. One
group believes that most compilers today can identify loops from the
flow of control through GOTO statements, and then perform loop
optimizations. Another group (myself included) believe that while
such sufficiently smart compilers might be imagined in practice they
are rare in the commercial world, and that most compilers today need
the "hint" that FOR or WHILE give them in order to trigger loop
optimization techniques.

The compilers we care the most about are for NT. Anyone have any insights?


Jim Allard Chief Architect, Core Technologies
Gensym Corporation jra@gensym.com
125 CambridgePark Drive (617) 547-2500 x252
Cambridge, MA 02140 FAX (617) 547-1962

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.