Time Left - 15:00 mins
GATE 2024 Compiler Design Foundation Quiz 46
Attempt now to get your rank among 36 students!
Question 1
Consider the following 3-address code:
t1 = t + e
t2 = g + a
t3 = t1 * t2
t4 = t2 + t2
t5 = t4 + t3
There are five temporary variables in above code. The minimum numbers of temporary variables that can be used in the equivalent optimized 3-address code of above code are ___.
Question 2
During intermediate code generation , we use 3 - address code in which we have 3 forms available : Quadruples , Triples and Indirect Triples. Now consider the below statements :
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 3
Find the minimum number of temporary variable which is used to represent the following 3 address code in the optimized manner ?
T1=a+b
T2=T1+c
T3=T1*T2
T4=2*T3
T5=T4+d
T6=T5+T4
T1=a+b
T2=T1+c
T3=T1*T2
T4=2*T3
T5=T4+d
T6=T5+T4
Question 4
Consider the following expression:
(((i + j) + (i × j) + ((i + j) × ( i + j))) + (((i + j) / (i × j))
The number of nodes in direct acyclic graph is a and edges is b, the value of 2a – b is ________.
Question 5
Match the following 3 address code notation with the type of address they carry in their table -
- 36 attempts
- 0 upvotes
- 0 comments
Apr 27GATE & PSU CS