Re: minimal nested block for declarations

Jeff Kenton <>
21 Nov 2003 00:45:21 -0500

          From comp.compilers

Related articles
minimal nested block for declarations (Derek M Jones) (2003-10-31)
Re: minimal nested block for declarations (Jeff Kenton) (2003-11-21)
| List of all articles for this month |

From: Jeff Kenton <>
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 =
= =

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.