GATE Computer ScienceHardGATE CS (PYQ pattern)

Using the backpatching scheme (each relation gives 'if r goto _' then 'goto _', no fall-through optimisation, numbering from 100), the code for while (a < b || c < d) while (e < f && g < h) x = x + 1; is generated. To which instruction number does the 'goto _' at 101 (the false exit of a < b) jump?

  1. A. 100
  2. B. 104
  3. C. 102
  4. D. 108

Correct answer: C. 102

The false exit of a<b in an 'or' goes to the test of c<d, which starts at 102.

More Compiler Design questions

Exams that ask this topic