Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!swrinde!mips!dimacs.rutgers.edu!rutgers!cmcl2!lanl!cochiti.lanl.gov!jlg From: jlg@cochiti.lanl.gov (Jim Giles) Newsgroups: comp.lang.c Subject: Re: low level optimization Message-ID: <22021@lanl.gov> Date: 19 Apr 91 22:52:08 GMT References: <21846@lanl.gov> <1991Apr18.233807.19552@zoo.toronto.edu> <21868@lanl.gov> <3906@inews.intel.com> Sender: news@lanl.gov Organization: Los Alamos National Laboratory Lines: 25 > You're so hyped up about the fact that separate compilation > prevents use of this optimization, but you haven't been > so vocal about the case where you deliberately alias one > of your arrays, which also blows your optimization. Since I _never_ deliberately alias array arguments either to each other or to globals to which the procedure I'm calling has access, this is not an issue to me. In _most_ code (not just mine) _most_ of the arrays that you pass around as parameters are not aliased and _most_ C compilers forgo a perfectly valid optimization in order to cater to the much rarer case where someone had "deliberately" aliased something. Deliberate aliasing happens all the time in processing recursive data structures (like linked lists, trees, graphs, etc.) but for array manipulation it is almost always a serious error - no matter how carefully the compiler works. It would be nice if C let me pass arrays to procedures _without_ converting them to pointers and it would be nice if the compiler were free to assume that array parameters were not aliased to each other or to any globals. If they become aliased to any locals, that could only happen through loaclly visible action that the compiler can see without interprocedure analysis. J. Giles