From: | fjh@cs.mu.OZ.AU |
Newsgroups: | comp.compilers |
Date: | 21 Mar 1996 23:50:54 -0500 |
Organization: | Compilers Central |
References: | 96-03-006 96-03-091 96-03-106 |
Keywords: | C, optimize |
cdg@nullstone.com (Christopher Glaeser) writes:
>> [Do people really not use const and static? -John]
>
>2) static - Static can cause significant performance problems for many
>C compilers. In particular, few C compilers can keep static variables
>in registers over a region of code.
I think the original poster who suggested using `static' for optimization
purposes was suggesting it as an alternative to making variables
and functions global, not as an alternative to using auto variables.
When used for this purpose, I suspect it may have some effect. For
example, compilers may be more inclined to inline a static function.
--
Fergus Henderson WWW: http://www.cs.mu.oz.au/~fjh
fjh@cs.mu.oz.au PGP: finger fjh@128.250.37.3
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.