Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!unixhub!stanford.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: <22687@lanl.gov> Date: 26 Apr 91 15:23:54 GMT References: <21961@lanl.gov> <11129@ncar.ucar.edu> <22246@lanl.gov> <1991Apr24.174057.22470@ee.eng.ohio-state.edu> Sender: news@lanl.gov Organization: Los Alamos National Laboratory Lines: 43 In article <1991Apr24.174057.22470@ee.eng.ohio-state.edu>, rob@kaa.eng.ohio-state.edu (Rob Carriere) rants: |> |> Err, yes it can. Someone else has already explained how to do this by |> including optimized and non-optimized versions of the code in the same object |> file. Since I assume that you read less selectively than you answer, I won't |> repeat his scheme. Yes, and I've already pointed out that this still relies on the _loader_ (or some post-translation tool) to make the actual decisions about what optimizations to use. Since I assume that you read less selectively than you answer, I won't repeat the discussion. |> [...] Mister Giles started this whole brouhaha with a claim |> that C coudn't be optimized as well as FORTRAN, since you needed to do IM |> analysis for that and the standard didn't allow such things. No, I didn't. I started this discussion by saying that C _isn't_ optimized as well as Fortran since you need IM analysis for that and the standard doesn't allow such things in the _translator_ and _no_ C implementation I've ever seen has the _loader_ (or any post- translation tool) do the job. Only _one_ C implementation has been brought to my attention which does IM analysis _at_all_. This is the MIPS C compiler, which does IM analysis in a non-standard way by requiring dependent compilation. Since I don't have access to the MIPS compiler, this info is of only academic interest. So - optimization of pointer arguments to procedures requires IM analysis in C. The translator can't do this and be standard conforming. If the translator leaves sufficient information in the object files, the loader (or some load-time tool) can make the optimizations (even if this only results in selecting among several versions that the compiler produced). In NO present implementation that does IM analysis is the method standard conforming. Finally, as I have pointed out before, I consider the MIPS method perfectly acceptable for all but commercial function libraries (which are inherently separately compiled so the vendor doesn't have to distribute source). There is nothing wrong with an implementation which provides an interesting capability as an _extension_ to the standard. What I object to is the claim that the extension _is_ standard. J. Giles