Related articles |
---|
minimal nested block for declarations derek@knosof.co.uk (Derek M Jones) (2003-10-31) |
Re: minimal nested block for declarations Jeffrey.Kenton@comcast.net (Jeff Kenton) (2003-11-21) |
From: | Jeff Kenton <Jeffrey.Kenton@comcast.net> |
Newsgroups: | comp.compilers |
Date: | 21 Nov 2003 00:45:21 -0500 |
Organization: | Comcast Online |
References: | 03-10-128 |
Keywords: | optimize |
Posted-Date: | 21 Nov 2003 00:45:21 EST |
Almost any compiler that analyzes live ranges for variables will figure this
out, and do the equivalent of what you suggest. This is especially true if
the variable gets allocated to a register (otherwise, it doesn't really matter
so much).
Derek M Jones wrote:
> In C (and other languages) most local declarations appear in the
> outermost block of the body of the function definition.
>
> Does anybody know of any studies that have analysed source to
> investigate the extent to which different declarations can be moved
> into some nested block?
--
-------------------------------------------------------------------------
= Jeff Kenton Consulting and software development =
= http://home.comcast.net/~jeffrey.kenton =
-------------------------------------------------------------------------
Return to the
comp.compilers page.
Search the
comp.compilers archives again.