GATE CS 2021 : Compiler Design 8 (App update required to attempt this test)
Attempt now to get your rank among 468 students!
Question 1
Question 2
p → q + r
s → p/t
p → s * u
s → s * p
The minimum number of total variables required to convert the above code segment in three address code static single assignment form is ________.
Question 3
p = 6
q = 7
t=p*q
s = t + p
u = 8
u =s* p
s =p+ u
r = r * q
t = t +p
return t
Assuming that all operations take their operands from registers. The minimum number of registers needed to execute this program without spilling is ________.
Question 4
Question 5
Question 6
Which of the following is true for the above control flow graph?
Question 7
a = b + c;
c = a + x;
d = b + c;
b = a + x;
The minimum number of edges required in DAG from the above code segment to a static single assignment form is ________.
Question 8
Total = sub1 + sub2 * 2
The total number of identifiers present in this expression are:
Question 9
(b+c)*(b+c)
Question 10
t1 = a – b;
t2 = t1 * c;
t3 = a – b;
t4 = t3 / t2
How many minimum variables are required in equivalent three address code for the above static single assignment code?
Question 11
Question 12
K=1
L2:S=1
L1:R1=8*K
R2=R1 + S
R3= 8* R2
B[R3]= 3
S++
IF S<=2 GOTO L1
K++
IF K<7 GOTO L2
The number of nodes and leaders in the control flow graph for the above code(written without spaces and in order) is?
Question 13
1) 1 2 3 4 5 6
2) 1 3 2 4 5 6
3) 1 3 2 4 6 5
4) 3 2 4 1 6 5
How many of the above are correct topological sorting?
Question 14
S1 : In Quadruples , statements can be moved around
S2 : In Triples , space is not wasted.
S3 : In Indirect Triples , space is not wasted but access time increases.
Which is correct ?
Question 15
((a+b)-((b+a)*(a-b) ) )+((a-b)*(a+b) )
The letters A through I are used to name the nodes, and are not part of the expression tree. The operator labels of the interior nodes are the +, -, or * adjacent to the nodes. Assume that + and * are commutative operators, although - is not. Construct the expression DAG from this tree, treating + and * as commutative.
Which of the following statements is TRUE(T)/FALSE(F) about which nodes will be combined?
(i) B and C will be combined
(ii) D and H will be combined
(iii) E and C will not be combined
(iv) F and I will not be combined
(v) I and G will not be combined
- 468 attempts
- 1 upvote
- 4 comments