Path: utzoo!utgpu!news-server.csri.toronto.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: <22352@lanl.gov> Date: 23 Apr 91 14:45:14 GMT References: <1991Apr18.233807.19552@zoo.toronto.edu> <21868@lanl.gov> <3906@inews.intel.com> <15903@smoke.brl.mil> Sender: news@lanl.gov Organization: Los Alamos National Laboratory Lines: 25 > [...] Any reasonable language that > supports pointer arguments needs to deal with this issue one > way or another; Fortran came down on the side of restricting > the programmer, while C came down on the side of empowering > the programmer. [...] No. Fortran restricted the programmer in one way, C restricted the programmer in a different way. In Fortran, if I want to do things in an overlapping way to a single array, I must pass that array around by itself and make the overlap explicit everywhere it occurs. In return for that constraint, the compiler optimizes my code _much_ better than it could if it had to assume all array arguments were aliased to each other. In C, the compiler prevents me from telling the compiler in any way whatsoever that pointer arguments are not aliased - even though they _usually_ aren't. In return, I get the dubious advantage of hiding overlap from procedures. For a language to _empower_ the user, it must provide a portable and explicit way of telling the compiler whether two arguments are allowed to be aliased. Neither language does this. In fact, no language in popular use does. J. Giles