GATE CS 2025 Set 1 | Question 13
Compiler Design › Intermediate Code & Code Optimization · MCQ · 1 mark · Answer: B
- Question 13Compiler Designmcq1 markWhich ONE of the following techniques used in compiler code optimization uses live variable analysis?
- A.Run-time function call management
- B.Register assignment to variables✓
- C.Strength reduction
- D.Constant folding
Answer: B
Solution
Answer: (B) Register assignment to variables Live variable analysis computes, for each program point, which variables are live (will be used before being redefined). This is exactly the information needed for register allocation: two variables that are never simultaneously live can share a register, and dead values need not be kept in registers. Strength reduction and constant folding are algebraic/value optimizations; run-time call management is unrelated to liveness. - A.
More GATE PYQ on Intermediate Code & Code Optimization
All GATE CS Compiler Design PYQ →Attempt GATE CS 2025 Set 1 in real GATE exam mode
Full paper with a timer, the GATE interface and a topic-wise analysis — free.
Create free account →