----- Original Message -----From:"Ron Natalie" <ron@ronnatalie.com>To:"Random832" <random832@fastmail.com>, "Steffen Nurpmeso" <steffen@sdaoden.eu>Cc:<tuhs@minnie.tuhs.org>Sent:Wed, 4 Jan 2017 11:58:41 -0500Subject:Re: [TUHS] Unix stories
There's a trademark between allowing the compiler to reorder things and having a defined order of operations.
Steps like that are well-defined in Java for instance. C lets the compiler do what it sees fit.
Note that it's not necessarily any better in assembler. There are RISC architectures where load-followed-by-store and vice versa may not always be valid if done in quick succession. Requiring the compiler to insert sequence points typically wastes a lot of cycles. Assembler programmers tend to think about what they are doing, the C compiler tries to do some of this on its own and its not clairvoyant.