Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC++inlining and the as-if ruleSingle-choice MCQ

Given the as-if rule and inlining, which transformation is the compiler NOT permitted to make even at -O3?

volatile int v; int f() { int a = v; int b = v; return a + b; // can the two loads of v be merged into one? }