Advanced
C++
Q94 / 100
What is the aliasing rule and its impact on compiler optimization?
Correct! Well done.
Incorrect.
The correct answer is B) The strict aliasing rule says pointers to different types cannot alias the same memory, allowing compilers to assume no interference and optimize aggressively
B
Correct Answer
The strict aliasing rule says pointers to different types cannot alias the same memory, allowing compilers to assume no interference and optimize aggressively
Explanation
If a compiler knows int* and float* can't alias, it reorders loads/stores freely. Violating strict aliasing (common in low-level code) is undefined behavior.
Progress
94/100