Re^2: Oh noooooo!!

Hubert Matthews hjm at cernvax.UUCP
Wed Sep 27 03:16:05 AEST 1989


In article <11132 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>In article <10756 at dasys1.UUCP> rpb at dasys1.UUCP (Robert Brady) writes:
>>Sorry, but Dijkstra was wrong. How can you attempt to write a program that
>>will be optimized in machine code by using constructs that are alien to 
>>machine code?
>
>Actually, most Algol-like languages can be better optimized with less
>effort if GOTOs are outlawed.  It has almost nothing to do with whether
>the machine language supports PC reloads (aka branch instructions).

Programs that don't use GOTOs generate only reducible flow-graphs;
programs that use GOTOs may generate irreducible flow-graphs.
Optimising a reducible flow-graph can be done without having to resort
to full data-flow analysis (just consider the problem of trying to
find loop-invariant expressions if you don't know trivially where the
loops are).  Thus, the optimiser can be simpler for languages such as
C, PASCAL and Modula-2 compared to FORTRAN.  Take a look in the Dragon
Book (Aho et al.) for more details.
-- 
Hubert Matthews      ...helping make the world a quote-free zone...

hjm at cernvax.cern.ch   hjm at vxomeg.decnet.cern.ch    ...!mcvax!cernvax!hjm



More information about the Comp.lang.c mailing list