Before revision: A safe reordering of the previous program is as follows: // declare a temporary local variable 'temp' of suitable type temp = *a + *b; *sum = temp + *c; Finally consider the indirect case with added function calls: *sum = f(*a) + g(*b); The compiler may choose to evaluate *a and *b before either function call, it may defer the evaluation of *b until after the function call f or it may defer the evaluation of *a until after the function call g. If the function f and g are free from program visible side-effects, all three choices will produce program with the same visible program effects.
After revision: aA safe reordering of the previous program is as follows: // declare a temporary local variable 'temp' of suitable type temp = *a + *b; *sum = temp + *c; Finally consider the indirect case with added function calls: *sum = f(*a) + g(*b); The compiler may choose to evaluate *a and *b before either function call, it may defer the evaluation of *b until after the function call f or it may defer the evaluation of *a until after the function call g. If the function f and g are free from program visible side-effects, all three choices will produce program with the same visible program effects.