Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!agate!ig!uwmcsd1!bbn!rochester!pt.cs.cmu.edu!sei!sei.cmu.edu!firth From: firth@sei.cmu.edu (Robert Firth) Newsgroups: comp.lang.c Subject: Re: Toy compilers (was Re: gotos) Message-ID: <5320@aw.sei.cmu.edu> Date: 3 May 88 19:16:28 GMT References: <1988Apr8.183815.3187@utzoo.uucp> <449@goofy.megatest.UUCP> <1988Apr24.012322.3951@utzoo.uucp> <504@wsccs.UUCP> <1080@maynard.BSW.COM> Sender: netnews@sei.cmu.edu Reply-To: firth@bd.sei.cmu.edu.UUCP (Robert Firth) Organization: Carnegie-Mellon University, SEI, Pgh, Pa Lines: 19 In article <1080@maynard.BSW.COM> campbell@maynard.UUCP (Larry Campbell) writes: >P.S. - I just compiled a "while (1)" loop on my system, which has one > of the wimpier C compilers around. It generated the right code > (i.e., no test instructions, just a jump to the top of the loop). Same here. I compiled the BCPL equivalent WHILE TRUE DO { Thing } and got out LA4: code for Thing BRB LA4 This is so obvious a micro optimisation I find it hard to believe any compiler won't do it.