Which of the following statements about constant propagation is correct?
2025
Which of the following statements about constant propagation is correct?
- A.
It applies only to loop variables.
- B.
It eliminates all unused variables.
- C.
It can lead to further optimizations like dead code elimination.
- D.
It increases code size.
Attempted by 24 students.
Show answer & explanation
Correct answer: C
Constant propagation replaces variables with their known constant values, enabling optimizations like dead code elimination.