GATE Computer ScienceModerateGATE CS (PYQ pattern)

A basic block has 8 three-address statements, of which 3 compute a triple identical to an earlier one. A compiler stores it as (i) quadruples, one row of 4 fields per statement, and (ii) indirect triples, where each distinct triple is stored once with 3 fields and each statement has a 1-word pointer. What are the totals of fields/words for (i) and (ii)?

  1. A. 32 and 32
  2. B. 32 and 23
  3. C. 24 and 23
  4. D. 32 and 24

Correct answer: B. 32 and 23

Quadruples: 8 × 4 = 32. Indirect triples: 5 unique triples × 3 = 15 plus 8 pointers = 23, so the sharing and reordering ability costs 8 pointer words but saves duplicates.

More Compiler Design questions

Exams that ask this topic