Path: utzoo!attcan!uunet!husc6!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.lang.c Subject: Re: Optimization (was Re: volatile) Message-ID: <1101@mcgill-vision.UUCP> Date: 16 May 88 07:52:08 GMT References: <13074@brl-adm.ARPA> <258@ateng.UUCP> Organization: McGill University, Montreal Lines: 28 Posted: Mon May 16 03:52:08 1988 In article <258@ateng.UUCP>, chip@ateng.UUCP (Chip Salzenberg) writes: > In article <13074@brl-adm.ARPA> dsill@NSWC-OAS.arpa (Dave Sill) writes: >> This bears repeating. There should be no circumstances under which >> the semantics of the language are changed by a flag to the compiler. Like -D? -I? -R? -fsingle? > This statement is, in my opinion, usually true. However, [the > semantics of C aren't simple]. For example, Dave may consider: > a = b; > a = b; > to mean "move data from b to a twice", which is what a simple C > compiler might do. On the other hand, some people -- myself included > -- consider that same C fragment to mean "assign b's value to a, then > assign b's value to a", which is redundant and subject to > optimization. As far as I can tell, those two meanings are exactly the same thing, stated two slightly different ways. The second one is not redundant if either a or b is volatile; and if neither is volatile, then the first one *is* redundant and subject to optimization. der Mouse uucp: mouse@mcgill-vision.uucp arpa: mouse@larry.mcrcim.mcgill.edu