Writing a complex program results in complex code. In general it is the job of the compiler to optimize complex functions. Some rules may help the compiler to generate efficient code.
If the target does not support powerful postincrement or postdecrement and preincrement or predecrement instructions, it is not recommended to use the `++' and `--' operator in complex expressions. Especially postincrement or postdecrement may result in additional code:
a[i++] = b[--j];
Write the above statement as:
j--; a[i] = b[j]; i++;
Using it in simple expressions as:
i++;
Avoid assignments in parameter passing or side effects (as ++ and --). The evaluation order of parameters is undefined (ANSI-C standard 6.3.2.2) and may vary from Compiler to Compiler, and even from one release to another: