Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!rpi!uupsi!cmcl2!lanl!cochiti.lanl.gov!jlg From: jlg@cochiti.lanl.gov (Jim Giles) Newsgroups: comp.lang.c Subject: Re: low level optimization Message-ID: <22004@lanl.gov> Date: 19 Apr 91 19:33:04 GMT References: <21660@lanl.gov> <15881@smoke.brl.mil> <21815@lanl.gov> <25371:Apr1907:22:5091@kramden.acf.nyu.edu> Sender: news@lanl.gov Organization: Los Alamos National Laboratory Lines: 26 It has been suggested that a program of the following type constitutes a counterexample to my previous statements about pointers and aliasing: func(i,j) char *i; float *j; ... However, my original statement about pointers and aliasing was that pointer arguments to the _same_ underlying type must be assumed to be aliased to each other and to all globals of that type (as well as any local object of that type whose address has possibly been assigned to one of these visible pointers, etc.). I admit that I also (and distinctly separately) mentioned that a prudent C compiler would also assume aliasing in many other cases because of the common practice that C programmers seem to covet of casting pointers in illegal ways. It is only in that sense that the above type of program is even relevant to anything I have been saying. In fact, I do believe that a prudent C implementation should assume that i and j in the above are aliased. But, since such aliasing is illegal, it does not trouble me that a standard conforming C compiler is free to assume that they are _not_ aliased. Either way, it does effect my main point. J. Giles