Try that code: ---8<--- int j = 2; int i = 2; i = i-- + ++j; cout << i; --->8--- The suprising result is that i == 1. I tried this on pc (intel), powerpc and sparc. The result is because the compiler does something like: ---8<--- tmp1 = i--; tmp2 = ++j; i = i + tmp2; i = tmp1; --->8--- (check the asm-code for more details). That's not what the programer expects.
Invalid as you are modifing i twice without a sequence point inbetween. i = i-- + ++j; ^ ^
Reopen these bugs...
...mark as duplicate of PR 11751. *** This bug has been marked as a duplicate of 11751 ***