Quadruple Record Structure in Compiler Intermediate Code

Quadruple Record Structure in Compiler Intermediate Code

Verified Sources
Sep 13, 2026

In compiler design, quadruple refers to an intermediate-code record format where each instruction is represented as a 4-part record, commonly written as langleop,arg1,arg2,resultrangle\\langle op, arg1, arg2, result \\rangle. This means a quadruple contains four fields, not three or one.
In many courses, this is contrasted with triples (typically 3 fields) and indirect addressing using temporaries, but the key idea for quadruples is that each operation stores both operands and the destination/result separately.

Mermaid view of the record layout:

Key terms:

  • Quadruple
  • Triples
  • Intermediate code
  • Three-address code

Quadruples vs Triples (Compiler Intermediate Representation)

Solving the given MCQ

Question: “Quadruple is a record structure of (i) three fields (ii) four fields (iii) one field (iv) none of these”

Since a quadruple is the IR record form langleop,arg1,arg2,resultrangle\\langle op, arg1, arg2, result \\rangle, it has exactly four fields.

Correct option: (ii) four fields.

Important caution: sometimes students confuse “quadruple” with “four-address” or with other IR variations. But the standard meaning of quadruple record structure in compiler textbooks is explicitly 4 components (operator, two operands, and result).
[CalloutBlock] below gives a quick mental check.

Pro Tip: 4-part memory check

If the record stores operator + operand1 + operand2 + destination, it’s a quadruple → 4 fields.

MCQ Reasoning Steps (Quadruple Fields)

  1. 1
    Step 1

    Interpret 'quadruple' as the standard compiler intermediate-code record format with a fixed number of components.

  2. 2
    Step 2

    Use ⟨op,arg1,arg2,result⟩\langle op, arg1, arg2, result \rangle as the canonical structure.

  3. 3
    Step 3

    There are 44 components: opop, arg1arg1, arg2arg2, and resultresult.

  4. 4
    Step 4

    Select the option that states four fields → (ii).

Where Quadruples Fit in Compiler Design

Parse & Analyze

Step 1

Source language constructs are identified."

Generate Intermediate Code

Step 2

Statements are converted into IR records such as triples/quadruples."

Optimize

Step 3

Simplifications and analysis may occur on the IR."

Translate to Target Code

Step 4

IR is mapped to machine/assembly instructions."

Mini comparison (common confusion)

Below is a compact comparison that helps distinguish triples from quadruples.

This directly implies:

  • Triples → 3 fields
  • Quadruple → 4 fields

Field Count Comparison: Triples vs Quadruples

How many fields each intermediate-code record typically contains.

FAQ / Edge Checks

Knowledge Check

Question 1 of 4
Q1Single choice

Quadruple is a record structure of: