What you have is an example of undefined behaviour.
The C/C++ specifications state that the compiler may evaluate an expression in any order.
Thus any expression which has multiple elements with side-effects makes no guarantee as to the result. Specifically, if there are multiple side effects on the same memory space, there is no guarantee of their application order.
Your expression in line 3 has side effects on the variable i twice, and uses the value of i three times. With no guarantee on execution order, what do you expect the result to be?
Also, as a side note, many compilers compute the arguments to functions/subroutines/methods in reverse order, so that they are pushed on the stack in correct order, and thus in ascending memory positions in the argument list. This, of course, assumes a stack which grows downward in memory.
Hopefully that helps.
Luck.