(A + B + C) ≠ (A + C + B) and compiler reordering
If the optimiser does such a reordering it is still bound to the C specification, so such a reordering would become: uint64_t u64_z = (uint64_t)u32_x + (uint64_t)u32_y + u64_a; Rationale: We start with uint64_t u64_z = u32_x + u64_a + u32_y; Addition is performed left-to-right. The integer promotion rules state that in the first addition … Read more