It's best not to depend on the order, at all.
x = f() + g(); y = f() + g();
It is possible, and allowed, that the first one will do f then g, and the second one will do g then f. The compiler may have enough information to realize it has a cached result of g.
Even with NO optimizations, you cannot make any assumptions on which will happen first.
If you REALLY need to have a particular order, use explicit temporaries:
fv = f(); gv = g(); x = fv + gv; fv = f(); gv = g(); y = fv + gv();
But, in my opinion, if the f() and g() functions have a order interdependency, the design is flawed.
HTH, --Eljay