Register allocation improvement is the job of code optimization(Machine dependent)
Output of Intermediate code generation is Machine independent, ICG is the last module of front end/Machine-Independent part of compiler. Output of ICG is taken by code optimization module which marks the beginning of machine dependent/Back end part of compiler.
Leaf node of a tree will not always have inherited attributes.
Eg S--->T+S|T
T-->id.
The difference between ICG code and assembly code lies in number of registers used for computation--->TRUE
ICG (uses as many temp. registers it needs without considering efficient usage)--->3 address cod(say)--->code optimization(reduces the number of register aloocation to minimal)--->target code generation------->Assembly language.