Tail call optimization (TCO) is an important optimization for recursive programs. Which of the following correctly describes when a recursive call is a tail call?
GATE CSE · Compiler Design
Master topic for Matching. Includes Code Generation, Code Optimization.
61 questions · 0 PYQs · 20 AI practice · GATE CSE 2027
Tail call optimization (TCO) is an important optimization for recursive programs. Which of the following correctly describes when a recursive call is a tail call?
Which of the following are valid methods to handle variable-length activation records (e.g., due to dynamic local arrays) during code generation?
Consider the following code with a loop:
for (i = 0; i < 100; i++) {
sum = sum + a[i];
}
How many times is the loop exit condition (i < 100) evaluated?
A basic block in the context of code generation is defined as:
Which of the following correctly describes instruction scheduling in code generation?
Static Single Assignment (SSA) form requires that each variable is assigned exactly once. Which of the following correctly describes how SSA handles variables assigned in multiple branches (e.g., if-else)?
Which of the following code generation issues are typically handled during the code generation phase?
Which of the following are true about the control flow graph (CFG) used in code optimization?
Consider the control flow graph given below. Which one of the following options is the set of live variables at the exit point of each basic block?

Consider the following basic block:
(1) a = b + c
(2) b = a - d
(3) c = b + c
(4) d = a - d
Which of the following pairs of instructions compute the same value (are common subexpressions)?
Alias analysis determines whether two pointers or references can point to the same memory location. Why is alias analysis important for code optimization?
Which of the following optimizations are applicable to the code: if (x > 0) { y = 1; } else { y = 1; }?
Consider generating code for the expression a[i][j] where a is a 2D array with row size R and element size w. The address of a[i][j] is:
Liveness analysis determines which variables are live at each program point. A variable x is live at point p if:
In code generation for a stack machine, which of the following sequence of instructions correctly evaluates a + b * c (assuming a, b, c are variables)?
Which of the following are common intermediate representations (IR) used in compilers before code generation?
Which of the following correctly describes the activation record (stack frame) structure generated by code generation for procedure calls?
In the context of code generation, what is 'spilling' a register?
Which of the following describes the difference between caller-saved and callee-saved registers in a calling convention?
Which of the following correctly describes the worklist algorithm for solving dataflow equations?
Want unlimited AI-generated Matching questions?
Sign up free and practice with adaptive difficulty — Easy, Medium, Hard. New questions every session.
Start practising for free →