Compiler Design MCQs (Set-4)

At a join, x has different incoming definitions; what SSA node merges them?

A Use-def edge
B Ο† node
C Copy token
D Basic block

In SSA, each Ο† input is associated with which item?

A Token pattern
B Successor instruction
C Predecessor block
D Source file

Given USE={x}, DEF={y}, OUT={y,z}, what is LIVEIN?

A {z}
B {x, y}
C {x, z}
D {x, y, z}

For a basic block B, how is LIVEOUT(B) computed?

A Intersection of successor USE
B Union of successor LIVEIN
C FIRST(B) plus IN
D FOLLOW(B) minus DEF

Interference-graph edges mean what about the represented values?

A Blocks share successors
B Instructions share source
C Values share a type
D Values overlap in liveness

During graph coloring, why can a node with degree below K be simplified safely?

A At least one color remains
B It cannot be spilled
C It has no live uses
D It needs no register

Suppose all usable registers conflict; what can an allocator do?

A Drop the instruction
B Spill a value to memory
C Change source language
D Erase the definition

When a live value occupies a caller-save register across a call, what protects it?

A Reorder past the call
B Remove its block
C Save and restore it
D Rename its token

Which Bison parser mode explores conflicting parses?

A Simple SLR
B Predictive LL
C Recursive descent
D Generalized LR

Merging same-core LR states can combine lookaheads and create which issue?

A Type mismatch
B Unreachable block
C Lexical error
D Reduce/reduce conflict

With nonassociative <, what should a<b<c require?

A Lexer backtracking
B Automatic right grouping
C Automatic left grouping
D Parentheses or rejection

For a completed non-start item A→α·, what does a valid lookahead permit?

A Reduce by A→α
B Accept the whole input
C Call the lexer again
D Shift every token

Undeclared-variable use is reported by which compiler stage?

A Lexical scanning
B Instruction scheduling
C Semantic analysis
D Object linking

Under short-circuit AND, when is q evaluated in p && q?

A Always after compilation
B Only when p is true
C Only when p is false
D Before evaluating p

In backpatching, what does truelist store?

A Unresolved true-branch targets
B Finished object offsets
C Matched identifier names
D Available register names

In the CFG, if every entry-to-n path passes through d, how is d related to n?

A d dominates n
B d is unreachable from n
C d shares a successor
D d post-dominates n

SSA requires what relationship between a definition and an ordinary use?

A Use dominates definition
B Definition follows the use
C Both share a successor
D Definition dominates every use

Why can a call block moving a memory load?

A It may modify aliased memory
B It renames a variable
C It deletes the CFG
D It changes token order

Alias analysis answers what memory-reference question?

A Lexical analysis
B Alias analysis
C FIRST/FOLLOW analysis
D Liveness analysis

If a stored value is overwritten before any read, which optimization can remove it?

A Constant folding
B Register spilling
C Loop unrolling
D Dead-store elimination

Besides invariant operands, what must loop hoisting preserve?

A Register allocation
B Symbol-table order
C Program behavior
D Token sequence

Degree at least K makes a node what in coloring?

A It has no neighbors
B It gets a free register
C Possible spill candidate
D It must be spilled

Rematerialization can help after a spill by doing what?

A Avoid parsing source
B Remove all memory access
C Make the graph bipartite
D Recompute a value cheaply

What location does an object-file relocation entry identify?

A A register needing liveness
B An address needing later adjustment
C A token needing classification
D A grammar rule needing reduction

Link-time optimization enables what across files?

A Optimization across translation units
B Lexer rule backtracking
C Parser state merging
D Token deletion