Some of those decisions are left up to the compiler as to how to evaluate an expression. You know the result and how it must get there from a mathematical and a C standpoint, though.
This is how LCC broke down your line of code into assembly without optimizations:
; 7 g = a/2 + b*4/a - abc/3;
- It loads a first, divides it by 2, and stores the result in a temp variable.
- It loads b into memory, fast multiplies by 4, divides by a, stores the result into the temp variable, and then adds the two temp values together.
- It moves the last variable, abc, divides by 3, subtracts it from the result of the addition of the previous two temp values, and finally sets G to the value.
This is all without optimizations, and it's rather a silly way to write it into assembly, but it works, and it's easy enough to explain.