Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Continuation-passing in C? Message-ID: <15618@smoke.brl.mil> Date: 28 Mar 91 22:24:34 GMT References: <1991Mar28.070649.1667@visix.com> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 16 In article <1991Mar28.070649.1667@visix.com> adam@visix.com writes: > foo( a, b, c ); > baz( a, b, c ); >I want the compiler to emit code that >(1) jumps directly from the end of foo to the start of baz, instead of >returning to main only to jump to baz >(2) leaves a, b, and c in registers instead of mucking around on a stack >(or leaves them on the stack instead of popping and pushing them) Really, why do you care? If this is bottleneck code you should perhaps look for other methods of optimizing it. This degree of attention to code generation is almost always pointless; the compiler will do the best it can to optimize the code it generates, and unless you're maintaining the compiler itself there's not much you can do about it. Indeed some compilers perform that kind of optimization and some do not.