Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ames!cit-vax!usc-oberon!sdcrdcf!psivax!csun!aeusemrs From: aeusemrs@csun.UUCP Newsgroups: comp.lang.c Subject: Re: C and overflow anomolies Message-ID: <568@csun.UUCP> Date: Sat, 11-Apr-87 20:15:35 EST Article-I.D.: csun.568 Posted: Sat Apr 11 20:15:35 1987 Date-Received: Mon, 13-Apr-87 23:47:06 EST References: <15958@sun.uucp> <5716@brl-smoke.ARPA> <14680@cca.CCA.COM> <790@xanth.UUCP> <995@wanginst.EDU> <820@xanth.UUCP> Reply-To: aeusemrs@csun.UUCP (Mike Stump) Distribution: world Organization: California State University, Northridge Lines: 47 In article <820@xanth.UUCP> kent@xanth.UUCP (Kent Paul Dolan) writes: [edited for space] |A previous poster has noted that a compiler writer who is on an optimization |spree (not meant to be derogatory, I have a lot of respect for this skill, |and spent a long bar evening listing to some justifiable bragging by one of |the practicioners of this bit of arcana) will not respect anything you can |do to force a certain code order, since s/he feels free to rearrange |statements, elide temporaries, rearrange loops, rearrange blocks, reduce |strength (change your multiplies to adds, for example), and recent |publications suggest that separate compilation may not be good enough, |either, to prevent unexpected interactions of two pieces of code which were |certainly separate in the programmer's mind. | |Second, this may provide insufficient or inappropriate granularity of |control against the optimizing compiler. I may need to control the order |of execution of a series of statements which the compiler may decide to |rearrange. The unary plus doesn't cut it here, but the compiler author |has promised to look everywhere for optimizations. How do I stop the code |from exercising optimization where it is dangerous to the success of the |program, without turning it off where it is harmless or beneficial? I |think the standard should include a better, prettier method of control of |optimization scope and degree. | |Comments? [just a couple questions for now] |Copyright 1987 Kent Paul Dolan. All Rights Reserved. Author grants |retransmission rights recursively only. [I guess I must include his copyright message...] Does optimization mean the changing of the internal workings of something, such that the inputs, and the results or outputs of the ``black box'' are the SAME, and of course, the process is less consuming in some way, typically time? Is this definition use only in theory, or is it used in practice too? Can you please give me an example of the case you alluded to, in your last paragraph above? I have never felt the need to have anything but, the full unrepressed optimizations, global or local, of the the compiler. With that I have one comment, I can see the use of storing values into areas of memory (or was that i/o, :-)) declared as volatile in C. What type of ``unexpected interactions of two pieces of code which were certainly separate in the programmer's mind'' where you referring to in your first paragraph? -- Mike Stump, Cal State Univ, Northridge Comp Sci Department uucp: {sdcrdcf, ihnp4, hplabs, ttidca, psivax, csustan}!csun!aeusemrs