Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!decwrl!mcnc!uvaarpa!murdoch!astsun9.astro.Virginia.EDU!gl8f From: gl8f@astsun9.astro.Virginia.EDU (Greg Lindahl) Newsgroups: comp.lang.misc Subject: Re: C's sins of commission Message-ID: <1990Nov2.052815.22188@murdoch.acc.Virginia.EDU> Date: 2 Nov 90 05:28:15 GMT References: <1990Oct26.155937.29185@maths.nott.ac.uk> <3673@stl.stc.co.uk> Sender: news@murdoch.acc.Virginia.EDU Organization: Department of Astronomy, University of Virginia Lines: 19 In article <3673@stl.stc.co.uk> "Tom Thomson" writes: >Jim's arrays and indices down them are all very well, but they certainly >do not solve the aliasing issue he claims they solve; if I write > a[i] := a[j] the compiler does not in general know whether i and j >have different values, ie whether i and j are distinct. Er, actually the example I use from my code looks like this: a[i] = b[i] / c[i]; d[i] = b[i] * c[i]; Fortran only loads b[i] and c[i] once. C, if you confuse the issue by using pointers, will generally load b[i] and c[i] twice. If the locations of b or c are passed in, no C compiler that I know of will optimize it. You can talk about the general case, and you can debate the definition of a pointer, but don't make my code run 30% slower.