Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!amdahl!pyramid!prls!philabs!micomvax!ray From: ray@micomvax.UUCP (Ray Dunn) Newsgroups: comp.lang.c Subject: Re: Keywords and optimization Message-ID: <1026@micomvax.UUCP> Date: 3 May 88 21:51:32 GMT References: <10575@steinmetz.ge.com> Reply-To: ray@micomvax.UUCP (Ray Dunn) Organization: Philips Electronics Ltd. (TDS - Montreal) St. Laurent QC, Canada Lines: 61 Keywords: volatile, noalias, optimize In article <10575@steinmetz.ge.com> davidsen@steinmetz.ge.com (William E. Davidsen Jr) writes: > > While I am generally against the addition of keywords into the >language, I am in favor of having some way for the programmer to specify >things which will make the program run faster, and to do so in a >portable way. At the risk of upsetting the Fundamentalists [we seem to have had a new net buzzword coined], but living, like you, in the real world, I agree. > Since alias and volatile effect the optimization process, >these are good things to specify, and if not with keywords then some >other (portable) way. > ... > Instead of fighting about this or that keyword, and why something >is/isn't needed, perhaps some of the people who have not joined the >screaming match could suggest a way in which this information could be >supplied to the compiler... > ...How about some solutions, rather >than opinions. The solutions in the world you are talking about already exist, but not unfortunately, portably. We don't need another solution for "volatile", it is there already (do I hear someone ask what all the noise was about?). On the subject of "noalias", it is unfortunate that ANSI defined it in such an ambiguous way that it was rightly bound to disappear from the standard. It will not however disappear totally from the *implementations*, where, as you know, it will continue to be supplied in various sensible and less-sensible forms (the -Oa of MS 4.0 (global "noalias") requires a corresponding "aliased" keyword or pragma to be really safe and useful - I've never fancied the idea of collecting together code I could safely compile with -Oa). All other things being equal, a portable solution is better than a non-portable one, but a non-portable one is better than none at all. If you want to screw out the last drops in a particular well defined environment, you have to use these ad-hoc features provided by your friendly compiler supplier who understands your marketplace. And, as most people who live in the real world know, in the short term, you don't worry too much about portability as the prime reason d'etre, when you are competing in a *specific* market. Again this in non-Fundamentalist doctrine, but I live in the street, not the 'C'hurch. The CEO of Lotus does not make $26,000,000 a year ensuring his IBM PC Lotus 123 was written portably but missed its market window or performance requirements! Now he *has*, he can probably take the time to port to whatever followup he desires, and can afford to pay the hacks to do the conversion! *head ducked between shoulders and asbestos suit firmly in place* -- Ray Dunn. | UUCP: ..!{philabs, mnetor}!micomvax!ray Philips Electronics Ltd. | TEL : (514) 744-8200 Ext: 2347 600 Dr Frederik Philips Blvd | FAX : (514) 744-6455 St Laurent. Quebec. H4M 2S9 | TLX : 05-824090