Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: unofficial X3J11 meeting notes Message-ID: <6833@brl-smoke.ARPA> Date: 15 Dec 87 04:09:20 GMT References: <6829@brl-smoke.ARPA> <9753@mimsy.UUCP> <6830@brl-smoke.ARPA> <9770@mimsy.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB)) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 40 Keywords: ANSI C standard In article <9770@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: ->>In article <6829@brl-smoke.ARPA> gwyn@brl-smoke.ARPA (Doug Gwyn) wrote: ->>>A new keyword, "noalias", was added.... ->In article <9753@mimsy.UUCP> I asked, essentially, ->>why not just use `register'? ----and of course, the answer is obvious: you cannot take the address -of a register. That's not the answer! The "noalias" type qualifier promises that the object can only be modified by a single handle (as I said), thereby permitting the optimizer to do things that are not safe otherwise; for example, for pointers that could be used as aliases accessing the same object, without "noalias" qualifying the object, every time it was modified via one pointer the compiler would have to assume that the modification might affect what is seen via the other pointer. With "noalias", the compiler is entitled to treat the two access paths as referring to non-overlapping objects, which means that it can assume that the result of a previous dereference (which may be in an active register) is not invalidated by a store through another pointer, so it does not need to reload the value already in the register just to be safe. The claim is that this is a big win for some optimizers, particularly those that vectorize operations. "Vanilla" use of C does not allow such optimizations in most cases. This issue is important to many people (mainly, those trying to optimize the dickens out of the code). I personally don't care much for this new feature. Fortunately, the typical programmer can just ignore it and never use "noalias" in his code, so it only affects those who like to fine-tune things. ->>>(char *) and (void *) have the same representation. [Doug] ->>Is this temporary? [me] ->It wasn't meant to be. [Doug] -Then why have (void *) at all? Type checking. Conversion between dissimilar pointer types generates a diagnostic while conversion to/from (void *) is silent.