2 ms·
There can always be things that trip the compiler. Without looking at the actual assembler, you never know that. Interestingly in your example, clang is able t
by bhaak 6y ago
There can always be things that trip the compiler. Without looking at the actual assembler, you never know that.
Interestingly in your example, clang is able to resolve the first and the third line to the same assembler code.
https://godbolt.org/z/navMEc https://godbolt.org/z/navMEc
I do wonder why it then isn't able to do that for the second line. Possibly because the CPU might have different flags set after processing the substraction?
But I'm not sure if your example is a good argument after I said I prefer less confusing code and you present an example which even confuses the compiler. ;-)