__REDUCING THE NUMBER OF TEMPORARIES.__ Temporaries are used to hold intermediate values
when evaluated expressions need to be stored in the symbol-table.

- They can require a lot of space for their values.
- Moreover wasting space implies wasting time. Indeed they have to be loaded into registers, written back, etc.
- For nowdays compilers, time performance is a crucial issue since space is almost illimited.

- There are a lot of different approaches to doing this
- and a lot of discussion about when during compilation it should be done.

- Consider the rule
*E**E*_{1}+*E*_{2} - Assume
*E*_{1}and*E*_{2}are evaluated into the temporaries*t*_{1}and*t*_{2}respectively. - From the rules for the synthesized attribute
*E*.*place*it follows that*t*_{1}and*t*_{2}are not used anywhere else in the program. - Moreover, if we
**do not use DAGS**for arithmetic expressions then the lifetime of each temporary used in the evaluation of*E*_{i}is contained in the lifetime of*t*_{i}. - Hence we can modify
*newtemp*- so that it assigns names for temporaries in a
*last-in, first-out*manner. - To do so we could store each temporary
*t*together with its scope*s*(*t*) such that we can reuse*t*in another scope from which*s*(*t*) is not visible. Scopes are naturally organized as a tree*T*and it is natural to associate a scope*s*with its depth*d*(*s*) as a node of*T*(the length of a shortest path from the root of*T*to*s*). For most languages (including MOOL, ALLCOT), if the current scope*s'*(entered after exiting*s*(*t*)) satisfies*d*(*s'*) <*d*(*s*(*t*)) then we can reuse*t*.

- so that it assigns names for temporaries in a

2004-12-02