Why do none of the major compilers optimize this conditional move?
Advertisements I stumbled across this Reddit post which is a joke on the following code snippet, void f(int& x) { if (x != 1) { x = 1; } } void g(int& x) { x = 1; } saying that the two functions are not equivalent to ‘the compiler’. I was convinced that any of… Read More Why do none of the major compilers optimize this conditional move?