GATE CS 2021 : Compiler Design 8 (App update required to attempt this test)
Attempt now to get your rank among 448 students!
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 ________.
p = 6
q = 7
s = t + p
u = 8
u =s* p
s =p+ u
r = r * q
t = t +p
Assuming that all operations take their operands from registers. The minimum number of registers needed to execute this program without spilling is ________.
Which of the following is true for the above control flow graph?
a = b + c;
c = a + x;
d = b + c;
b = a + x;
The minimum number of total variables required to convert the above code segment to static single assignment form is ________.
Total = sub1 + sub2 * 2
The total number of identifiers present in this expression are:
a = (b+c)*(b+c)
t1 = a – b;
t2 = t1 * c;
t3 = a – b;
t4 = t3 / t1
How many minimum variables required in equivalent three address code for the above static single assignment code?
R2=R1 + S
R3= 8* R2
IF S<=2 GOTO L1
IF K<7 GOTO L2
The no of nodes and leader in the control flow graph for the above code(written without spaces and in order) is
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?
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 ?
((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
- 448 attempts
- 1 upvote
- 4 comments