Machine-translated by Google. Questions are authored in English.
Top

Discussion

A variable is live at a point if

  • A.it has been assigned some value earlier on in the program
  • B.it is declared in the innermost enclosing block
  • C.it appears anywhere in the procedure being analysed
  • D.its current value may be used along some path from that point

Answer: D

Correct answer: its current value may be used along some path from that point

Liveness is a backward analysis and again a may property: the variable is live if any path from here reads it before writing it. Its principal use is register allocation, since two variables that are never live at the same time can share a register, and dead code elimination, since an assignment to a dead variable can be deleted.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.