From mboxrd@z Thu Jan 1 00:00:00 1970 From: ron@ronnatalie.com (Ron Natalie) Date: Wed, 4 Jan 2017 11:58:41 -0500 Subject: [TUHS] Unix stories In-Reply-To: <1483548842.1612851.837252537.064CFDA2@webmail.messagingengine.com> References: <5257291ca0a0e1d80c646cab730129d589c5d707@webmail.yaccman.com> <42922C34-342F-4E86-83E2-3618129139B2@tfeb.org> <20170103004959.GA29088@mcvoy.com> <20170104130434.NQFzLGpVU%steffen@sdaoden.eu> <1483538831.1573798.837053385.2EB8CAC9@webmail.messagingengine.com> <012e01d2669a$6b2f89c0$418e9d40$@ronnatalie.com> <1483545543.1599443.837188969.6EAAD62B@webmail.messagingengine.com> <20170104163017.XtxbzN7PQ%steffen@sdaoden.eu> <1483547544.1606930.837228297.014AB061@webmail.messagingengine.com> <20170104165120.rYUyVGovj%steffen@sdaoden.eu> <1483548842.1612851.837252537.064CFDA2@webmail.messagingengine.com> Message-ID: <017201d266ab$cda885a0$68f990e0$@ronnatalie.com> 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.