Consider the control flow graph shown in the figure. Which one of the following options correctly lists the set of redundant expressions (common subexpressions) in the basic blocks B and B ? Note: All the variables are integers.

GATE CSE · Compiler Design
Generate GATE-level questions covering three-address code, syntax trees, DAG, quadruples, triples, indirect triples, and translation schemes. Include representation and conversion problems.
60 questions · 20 PYQs · 0 AI practice · GATE CSE 2027
🎯 These are sample questions
Just sign in to unlock everything. Free for all students.
Consider the control flow graph shown in the figure. Which one of the following options correctly lists the set of redundant expressions (common subexpressions) in the basic blocks B and B ? Note: All the variables are integers.

Which ONE of the following techniques used in compiler code optimization uses live variable analysis?
Refer to the given 3-address code sequence. This code sequence is split into basic blocks. The number of basic blocks is _________. (Answer in integer) 1001: i = 1 1002: j = 1 1003: t1 = 10i 1004: t2 = t1+j 1005: t3 = 8t2 1006: t4 = t3-88 1007: a[t4] = 0.0 1008: j = j+1 1009: if j <= 10 goto 1003 1010: i = i+1 1011: if i <= 10 goto 1002 1012: i = 1 1013: t5 = i-1 1014: t6 = 88*t5 1015: a[t6] = 1.0 1016: i = i+1 1017: if i <= 10 goto 1013
Consider the following statements about the use of backpatching in a compiler for intermediate code generation: (I) Backpatching can be used to generate code for Boolean expression in one pass. (II) Backpatching can be used to generate code for flow-of-control statements in one pass. Which ONE of the following options is CORRECT?
Consider the following expression: . The following sequence shows the list of triples representing the given expression, with entries missing for triples (1), (3), and (6).
Which one of the following options fills in the missing entries CORRECTLY?
Consider the following pseudo-code.
Which of of the following options CORRECTLY specifies the number of basic blocks and the number of instructions in the largest basic block, respectively?
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.
Consider the following ANSI C code segment: z=x + 3 + y-> f1 + y-> f2; for (i = 0; i < 200; i = i + 2) { if (z > i) { p = p + x + 3; q = q + y-> f1; } else { p = p + y-> f2; q = q + x + 3; } } Assume that the variable y points to a struct (allocated on the heap) containing two fields f1 and f2, and the local variables x, y, z, p, q, and i are allotted registers. Common sub-expression elimination (CSE) optimization is applied on the code. The number of addition and the dereference operations (of the form y -> f1 or y -> f2) in the optimized code, respectively, are:
In the context of compilers, which of the following is/are NOT an intermediate representation of the source program?
Which of the following is a type of a out-of-order execution, with the reordering done by a compiler
Consider the productions and . 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?
Which of the following comment about peep-hole optimization is true?
Consider the expression ( a-1)* (((b + c) / 3) + d)) . Let X be the minimum number of registers required by an optimal code generation (without any register spill) algorithm for a load/store architecture in which (i) only loads and store instructions can have memory operands and (ii) arithmetic instructions can have only register or immediate operands. The value of X is _________.
Consider the following intermediate program in three address code p= a -b q= p *c p= u * v q= p + q Which one of the following corresponds to a static single assignment form of the above code?
Peephole optimization is form of
Consider the following code segment. x =u-t; y =xv; x =y+w; y =t-z; y =xy; The minimum number of total variables required to convert the above code segment to static single assignment form is__________ .
Consider the intermediate code given below. (1) i = 1 (2) j = 1 (3) t1 = 5 * i (4) t2 = t1 + j (5) t3 = 4 * t2 (6) t4 = t3 (7) a[t4] = -1 (8) j = j + 1 (9) if j 5 goto (3) (10) i=i+1 (11) if i 5 goto (2) The number of nodes and edges in the control-flow-graph constructed for the above code, respectively, are
The least number of temporary variables required to create a three-address code in static single assignment form for the expression q + r / 3 + s - t * 5 + u * v /w is _______________.
A variable x is said to be live at a statement in a program if the following three conditions hold simultaneously: i. There exists a statement that uses x ii. There is a path from to in the flow graph corresponding to the program iii. The path has no intervening assignment to x including at and The variables which are live both at the statement in basic block 2 and at the statement in basic block 3 of the above control flow graph are

In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the following is TRUE?
Want unlimited AI-generated Intermediate Code Generation questions?
Sign up free and practice with adaptive difficulty — Easy, Medium, Hard. New questions every session.
Start practising for free →