Path: utzoo!utgpu!water!watmath!clyde!rutgers!umd5!brl-adm!adm!dsill@NSWC-OAS.arpa From: dsill@NSWC-OAS.arpa (Dave Sill) Newsgroups: comp.lang.c Subject: Re: More on noalias Message-ID: <11230@brl-adm.ARPA> Date: 12 Jan 88 18:32:38 GMT Sender: news@brl-adm.ARPA Lines: 42 [Chris Torek suggests that a general mechanism for giving the compiler hints is needed. Further, he suggests that noalias could be replaced by such a hint and that such a mechanism could also give flow control hints.] >... Too bad you cannot say > > compiler_hint(flow: probability i < 0: .001); This looks like a prime pragma candidate to me: #pragma flow (probability, i<0, .001) >No matter what it is the compiler wants to know, if you have a >general mechanism, you can tell it. With `noalias' you can only >tell it about aliasing. Unfortunately, as Doug Gwyn has already pointed out, pragmas can't be used to replace `noalias'. (I don't understand `noalias' well enough myself to understand why) >To reword the `summary' line above, if we >must have compiler hints, let us at least make them general. ANS >X3J11 could specify the form which some compiler hints should take, >specifically those involving aliasing. What pragmas need to be useful is a procedure like that used by the ISO to register escape sequences. Rather than having X3J11 specify a list of pragmas and their behavior (which they obviously won't do), they could maintain a list of pragmas submitted by vendors. This would reduce the likelyhood of two vendors implementing the same pragma but with different behavior. E.g., "#pragma optimized" on vendor A's compiler might mean "turn on optimizing" while on vendor B's compiler it means "this code has been hand optimized, don't try to improve it". Perhaps pragmas were intended to be machine dependent, but I think they could and should be more general. ======== The opinions expressed above are mine. Which is worse: ignorance or apathy? Who knows? Who cares?