Skip to content
GATEiit

GATE CSE 2017 Session 1 Q22: Static single assignment (SSA) form of three-address code

Syllabus topic: Intermediate code generation

Question

Consider the following intermediate program in three address code

p = a - b
q = p * c
p = u * v
q = p + q

Which one of the following corresponds to a static single assignment form of the above code?

Try it: multiple choice: exactly one correct option

Select one option
Wrong answer costs 1/3 mark in GATE.
Show answer and explanation

Answer: B (official GATE 2017 final answer key)

Concept used: In SSA form every variable is assigned exactly once, and each use refers to the version produced by the reaching definition.

Concept notes

Loading notes…

First step: Check each option for (i) a fresh name on every assignment and (ii) each use naming the most recent definition.

Full step-by-step solution

Loading…

Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.

More questions on Intermediate code generation

Every PYQ on this topic →

Share this question

WhatsAppDownload image

Source: official GATE 2017 Session 1 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key