in Compiler Design edited by
961 views
0 votes
0 votes
a x b x c + d - a + e x f - g + h
order of precedence : x>+>- ; with x is left associative and +, - as right.
Min number of variables required in TAC?
Should'nt the expression be expressed as :

((a x b) x c) + d - a + (e x f) - g + h
(((a x b) x c) + (d - (a + (e x f)) - (g + h)))
in Compiler Design edited by
961 views

4 Comments

@Hemanth_13 The question is minimum number of variables required in three address code, does that mean SSA?

0
0
No SSA explicitly mention if they ask

see previous years 2015,16,17 questions
1
1
SSA is not mentioned..so 3 variables
1
1

2 Answers

3 votes
3 votes

Make sure it is 3 address code not SSA

so we can reuse temporary variable after using * > + > - precedence

* Left to right associative rest Right to Left

 

0 votes
0 votes
It must be 16 temporary variable.

(T1 to T8) and (a to h )

1 comment

answer should  3 variables

.
0
0

Related questions