Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uwm.edu!psuvax1!rutgers!mit-eddie!uw-beaver!cornell!vax5.cit.cornell.edu!umh From: umh@vax5.cit.cornell.edu Newsgroups: comp.arch Subject: Optimising C compiler question Message-ID: <1991Apr8.193155.3911@vax5.cit.cornell.edu> Date: 8 Apr 91 23:31:55 GMT Distribution: comp Organization: CIT, Cornell University Lines: 19 Something I wonder about. C has provision for register variables, which are supposed to run faster than standard variables. How come one never sees register variables in any code? Are modern RISC compilers sufficiently good that they automatically make sensible choice of register variables? Can I make my code run slower by using them? In like vein, C has the feature that you can create variables local to some part of your function: something like if( condition )$ int i; . . and i is invisble to the rest of your code. Can judicious use of this speed things up- the compiler should know it doesn't have to save i when it leaves that block etc? Maynard Handley