Intermediate Code Generation


Question 1
Consider the following statements regarding the front-end and back-end of a compiler.

S1: The front-end includes phases that are independent of the target hardware.
S2: The back-end includes phases that are specific to the target hardware.
S3: The back-end includes phases that are specific to the programming language used in the source code.

Identify the CORRECT option.
A
Only S1 is TRUE.
B
Only S1 and S2 are TRUE.
C
S1, S2, and S3 are all TRUE.
D
Only S1 and S3 are TRUE.
GATE CSE 2023   Compiler Design
Question 2
In the context of compilers, which of the following is/are NOT an intermediate representation of the source program?
A
Three address code
B
Abstract Syntax Tree (AST)
C
Control Flow Graph (CFG)
D
Symbol table
GATE CSE 2021 SET-2   Compiler Design


Question 3
Which of the following is a type of a out-of-order execution, with the reordering done by a compiler
A
loop unrolling
B
dead code elimination
C
strength reduction
D
software pipelining
ISRO CSE 2020   Compiler Design
Question 4
Consider the productions A\rightarrow PQ and A\rightarrow XY. Each of the five non-terminals A,P,Q,X, and Y has two attributes: s is a synthesized attribute, and i is an inherited attribute. Consider the following rules.

Rule 1: P.i=A.i+2, Q.i=P.i+A.i, and A.s=P.s+Q.s
Rule 2: X.i=A.i+Y.s and Y.i=X.s+A.i

Which one of the following is TRUE?
A
Both Rule 1 and Rule 2 are L-attributed.
B
Only Rule 1 is L-attributed.
C
Only Rule 2 is L-attributed.
D
Neither Rule 1 nor Rule 2 is L-attributed.
GATE CSE 2020   Compiler Design
Question 5
Which of the following comment about peep-hole optimization is true?
A
It is applied to small part of the code and applied repeatedly
B
It can be used to optimize intermediate code
C
It can be applied to a portion of the code that is not contiguous
D
It is applied in symbol table to optimize the memory requirements.
ISRO CSE 2018   Compiler Design


There are 5 questions to complete.

1 thought on “Intermediate Code Generation”

Leave a Comment